garethtnash
asked on
Double Quotes - Help
Hello, I hope you can help me,...
I have the following code --
But it's getting broken, when the following code gets sent -
I'm guesssing the issue here is -
<span id="dtlview_Description">
I've tried everything to replace the "...
Help!!
I have the following code --
<%
dim notes
notes = """
notes = notes + trim(Left(RSNotes("Notes"),50))
notes = notes + "..."<br/>"
notes = replace(notes,"<p>","")
notes = replace(notes,"</p>","")
notes = replace(notes,"“", "")
With response
.write("<a class=""inline"" href=""#deletenote"" title=""Delete Note"" onclick=""document.getElementById('NoteID').value = '" &(RSNotes("id"))& "';document.getElementById('notedetail').innerHTML='" &(notes)& " posted by " & (RSNotes("HQContact"))& " on " & (RSNotes("Date"))& "'"">" & VbCrLf)
.write("Delete" & VbCrLf)
.write("</a>" & VbCrLf)
End With
%>
But it's getting broken, when the following code gets sent -
<p><span id="dtlview_Description">SB sent information pack 13/11/09.<br />New member pack posted 12/01/10 SB.</span></p>
I'm guesssing the issue here is -
<span id="dtlview_Description">
I've tried everything to replace the "...
Help!!
What is the exact error you are getting?
ASKER
Hi Padas,
instead of a link that sais edit, i get --
instead of a link that sais edit, i get --
<a class="inline" href="#editnote" title="Edit Document" onclick="document.getElementById('noteId').value = '117';document.getElementById('note').innerHTML='<p><span id=" dtlview_description"="">SB sent information pack 13/11/09.<br>New member pack posted 12/01/10 SB.</a>
I don't see anything in your code with "edit".
Work backwards. Start with the the code you want to end up with. Then build your vb to create.
This part of your rendered code looks wrong
id=" dtlview_description"="">
Work backwards. Start with the the code you want to end up with. Then build your vb to create.
This part of your rendered code looks wrong
id=" dtlview_description"="">
Can you please try replacing line 3 -9 with code as provided:
dim notes
notes = """
notes = notes + trim(Left(test,50))
notes = notes + "..."<br/>"
notes = replace(notes,"<p>","")
notes = replace(notes,"</p>","")
notes = replace(notes,"“", "")
notes = replace(notes,"""", "'")
ASKER
Hi Padas,
Hope you had a good weekend?
So I changed the code to this --
Which gives me --
but when I click the link, the fancybox opens with a '?', I'm guessing that this is because we have unclosed tags "<span id='dtlview_Description'>"
Should I strip these? Any idea how best to do this?
Thanks
Hope you had a good weekend?
So I changed the code to this --
<%
dim notes
notes = """
notes = notes + trim(Left(RSNotes("Notes"),50))
notes = notes + "..."<br/>"
notes = replace(notes,"<p>","")
notes = replace(notes,"</p>","")
notes = replace(notes,"“", "")
notes = replace(notes,"""", "'")
With response
.write("<a class=""inline"" href=""#editnote"" title=""Edit Document"" onclick=""document.getElementById('noteId').value = '" &(RSNotes("id"))& "';document.getElementById('note').innerHTML='" &(notes)& "'"">" & VbCrLf)
.write("Edit" & VbCrLf)
.write("</a>" & VbCrLf)
End With
response.Write("|")
With response
.write("<a class=""inline"" href=""#deletenote"" title=""Delete Note"" onclick=""document.getElementById('NoteID').value = '" &(RSNotes("id"))& "';document.getElementById('notedetail').innerHTML='" &(notes)& " posted by " & (RSNotes("HQContact"))& " on " & (RSNotes("Date"))& "'"">" & VbCrLf)
.write("Delete" & VbCrLf)
.write("</a>" & VbCrLf)
End With
%>
Which gives me --
<a class="inline" onclick="document.getElementById('noteId').value = '117';document.getElementById('note').innerHTML='"<span id='dtlview_Description'>SB sent informat..."<br/>'" title="Edit Document" href="#editnote"> … </a>
but when I click the link, the fancybox opens with a '?', I'm guessing that this is because we have unclosed tags "<span id='dtlview_Description'>"
Should I strip these? Any idea how best to do this?
Thanks
The best thing to do is create a static link, then go backwards and build your vb.
I think this is the static link you want.
I think this is the static link you want.
<a class="inline" onclick="document.getElementById('noteId').value = '117';document.getElementById('note').innerHTML=''<span id='dtlview_Description'>SB sent informat...<br></span>"; title="Edit Document" href="#editnote"> link here</a>
ASKER
Hi,
I found a solution to this also...--
But, to this I also need to remove line breaks (not <br/>), any suggestions Padas?
Thank you
I found a solution to this also...--
<%
Function stripHTMLtags(HTMLstring)
Set RegularExpressionObject = New RegExp
With RegularExpressionObject
.Pattern = "<[^>]+>"
.IgnoreCase = True
.Global = True
End With
stripHTMLtags = RegularExpressionObject.Replace(HTMLstring,"")
Set RegularExpressionObject = nothing
End Function
%>
But, to this I also need to remove line breaks (not <br/>), any suggestions Padas?
Thank you
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
Thank you