How can I get the dropdown's selected value

D

Devdex Developer

You have to submit ur form under which your drop down element exist.
After submitting you can get it's value like this
to display
Response.Write request("NameOfcontrol")
to assign to some variable
ur variable request("NameOfcontrol")

Or you can even catch it with out submiting through java script.
 
D

Devdex Developer

Guinness Mann no body is perfect is this IT world.Can u think bill gates
knows how to programme in Java . Absolutely not. So pls encourage other
fellow developers.
thanx
peace
 
B

Bob Barrows [MVP]

janice said:
I need help to display the selected value from database in the
dropdown list. Following is my code...but there are some error:

We are not looking over your shoulder at your screen. You need to tell us
what the errors are.
 
T

Thomas Dodds

while NOT rs.EOF
If rs("Description") = rsStatus("sc_status") Then
strSelect = "SELECTED"
else
strSelect = ""
end if

Response.Write ("<option value = '" & rs("Description") & "' " &
strSelect & ">")
Response.Write (rs("Description"))
Response.Write ("</option>")

rsStatus.MoveNext
wend
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top