Dynamic Dropdown Lists Support Product Page

This topic was archived

Doesn't show double quotes

Asked 06 Oct 2005 01:19:41
1
has this question
06 Oct 2005 01:19:41 Chieu Thang posted:
I have the drop down list working properly. I created a add button wich adds the value to a text box. It does not like anything in double quotes. It still works but does not display anything fter the double quotes.

I think this is where the problem lies in the code.

<select name="dropdownbox">
<%
While (NOT Recordset2.EOF)
%>
<option value="<%=(Recordset2.Fields.Item("comment".Value)%>" ><%=(Recordset2.Fields.Item("label".Value)%></option>
<%
Recordset2.MoveNext()
Wend
If (Recordset2.CursorType > 0) Then
Recordset2.MoveFirst
Else
Recordset2.Requery
End If
%>
</select>
<input type=button value="Add" onClick="passText(this.form.dropdownbox.options[this.form.dropdownbox.selectedIndex].value);" name="button" class="button1">
</p>
<p>
<textarea name="comment_term1" rows="10" cols="100"></textarea>
</p>

any help would be great.

Thanks

Replies

Replied 06 Oct 2005 10:15:28
06 Oct 2005 10:15:28 Charlie Bartlett replied:
Wow I almost forgot about this article I worte it about 3 years ago , and haven't looked at it much since. In fact I don't even use Dreamweaver anymore.
But you could try changing
<%=(Recordset2.Fields.Item("label".Value)%>
to
<%=Server.HTMLEncode(Recordset2.Fields.Item("label".Value)%> that should do the trick. I think.
Charlie.

Reply to this topic