Click to See Complete Forum and Search --> : Question on quotation mark in textbox


Squall Leonhart
11-14-2003, 11:53 AM
Hi, guys again.

Please take a look at this.:)


<input type="text" name="title" style="width:450px" maxlength="100" value="<%=rsAddComments.fields("title")%>">


When the page with this code loads, if there is value like s8ss7s" in the database and it shows up in the text box,
value appears like this s8ss7s <- not showing quotation mark.

so I changed value="<%=rsAddComments.fields("title")%>"
into value='<%=rsAddComments.fields("title")%>'.

That made quotation mark show up. But this time,
when i load the value like ss8ss' from database to textbox,
value shows up like this ss8ss missing single quotation mark.

so this time I wrote like this value=&quot;<%=rsAddComments.fields("title")%>&quot;
This time value ss8ss from database appears "ss8ss" like this.

So I wonder how I can solve this and if you guys had same problem. Thanks

rdoekes
11-15-2003, 02:29 PM
<input type="text" name="title"
style="width:450px" maxlength="100"
value="<%=Server.HTMLEncode(rsAddComments.fields("title"))%>">

Squall Leonhart
11-17-2003, 12:52 PM
:) Thank you.