Click to See Complete Forum and Search --> : [RESOLVED] Select Value


danasegarane
10-13-2006, 01:58 AM
Dear Team,
I am using this code,to assign the value to a select box item

<OPTION selected value=<%=rs("Snip_Desc")%>)><%=rs(2)%></OPTION>

and in the onchange I am giving an alert to display the data as

<SELECT id=select2 style="WIDTH: 243px"
name=select2 onchange="alert(select2(1).value)"> <OPTION selected value="">Function Name</OPTION>


In this issue the value value "(rs("Snip_Desc")" is "this is for testing".But the alert gives as "this only".I don't know why.Pleas help.
I tried this one also.But the same output.

<SELECT id=select2 style="WIDTH: 243px"
name=select2 onchange="alert(this.value)"> <OPTION selected value="">Function Name</OPTION>

Terrorke
10-13-2006, 02:42 AM
use :

<OPTION selected value='<%=rs("Snip_Desc")%>'><%=rs(2)%></OPTION>

This will help

danasegarane
10-13-2006, 02:57 AM
Thanks TerrorKe,
It worked