Forum Moderators: open
When I enter a string in the database as follows:
this is a "test"
it becomes part of the SQL as
'this is a "test"'
and enters the DB just fine. When I build a drop down list with that value, it shows up with the double quotes.
However, when I select it, and try to display that in a text box, all I see is:
this is a
WHY?
The "test" portion of the text is indeed in the source, but the HTML tag double quote blocks it from showing.
<input type="text" value="this is a "test"">
the double quote effectively ends the value attribute.
So, this works instead:
<input type="text" value='this is a "test"'>
Silly Rabbit - kicks are for trids.
Function TextToInput(strInput)
TextToInputValue = Replace(strInput, """", """)
End Function
i.e.
<input type = "text" name = "something" value = "<%=TextToInput(strMyVar)%>">
Granted, this is for classic ASP, but the idea can be ported elsewhere.
[w3.org...]