Jump to content

get text value from dropdown list


juggysingh

Recommended Posts

Hi, :)Is there anyway to retrieve the selected text value aswell as the value from a drop down list?

<select name="dropdwn1" id="dropdwn1" size="1">  <option value="0" selected="selected">Choose</option>  <option value="value1">text1</option>  <option value="value2">text2</option></select>

Link to comment
Share on other sites

Is there anyway to retrieve the selected text value aswell as the value from a drop down list?
Depends on how you want to retrieve it. If you want to get it in PHP you need to do as jsg said and include the text in the value of the option, then break it apart in PHP. However, you can access the selected options text using JavaScript.http://w3schools.com/jsref/dom_obj_select.asp
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...