jlange Posted July 9, 2007 Share Posted July 9, 2007 Hi all, I'm not the best with JScript, and I've hit a roadblock in one of my projects because of it. I have a <select> with a lot of options, and another form with fields like username, password, first name, last name, etc. I would like those fields to fill with the information relating to whatever is selected in that <select> The data is generated via PHP from a MySQL database, if that serves any use. I look forward to hearing from you! This community is a great example of how the web lets people help one another and all that sappy stuff. PS, go easy on me, JScript to me is somewhat confusing, what with this.that.this(blah).that = this...PHP seems easier to me. Link to comment https://forums.phpfreaks.com/topic/59085-getting-information-from-a-form-item/ Share on other sites More sharing options...
RichardRotterdam Posted July 9, 2007 Share Posted July 9, 2007 getting the value of a select is easy <!--this.value is passed to the function showValue()--> <select id="myselect" onchange="showValue(this.value)"> <option value="1">1</option> <option value="2">1</option> <option value="3">1</option> </select> <script> function showValue(val){ //this will alert the value of the selected option alert(val); } </script> Link to comment https://forums.phpfreaks.com/topic/59085-getting-information-from-a-form-item/#findComment-293546 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.