juggysingh Posted March 15, 2010 Share Posted March 15, 2010 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 More sharing options...
justsomeguy Posted March 15, 2010 Share Posted March 15, 2010 No, the browser will only submit the value. You can add the text portion to the value if you want, and break it up in PHP. Link to comment Share on other sites More sharing options...
ShadowMage Posted March 15, 2010 Share Posted March 15, 2010 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.