Need help
I have following code with classic asp
<select name="state" id="state">
<option value="NJ">New Jersey</option>
</select>
Now i want just “NJ” not “New Jersey” while entering in database but it is storing “New Jersey”.
on submit button in postback i am trying to read value using
if gAspClassUtil.isSubmitted("submit") then
Selectedstate = Request.form("state")
end if
but at this time value in “Selectedstate” is “New Jersey” not “NJ”
Please suggest me how to read option “VALUE” not “TEXT” from dropdown list
in classic asp.
What you are saying simply doesn’t happen.
If you have a
valueattribute in anoptiontag, the value will be sent in the form data, not the text.The
Request.Formcollection only contains the data that is posted to the server. Only the value (if present) is sent to the server, the text from the option is not even possiple to get from the form data.Some things to check:
selectelement is actually inside theformelement that is posted.