Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
111
rated 0 times [  114] [ 3]  / answers: 1 / hits: 15103  / 12 Years ago, wed, december 5, 2012, 12:00:00

How would I make a drop down menu post automatically when an option has been chosen?



<SELECT NAME=select_page><?php echo $options1;?></SELECT>


What is the best way to achieve this?


More From » php

 Answers
26

You can utilize the onchange event for the select element, and code a form submit:



<form method=post>
<select name=myselect onchange=this.form.submit();>
<option>blue</option>
<option>red</option>
</select>
</form>


That will automatically submit the form when the value is changed.


[#81594] Tuesday, December 4, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
analiseb

Total Points: 252
Total Questions: 96
Total Answers: 106

Location: Singapore
Member since Sat, Jul 25, 2020
4 Years ago
analiseb questions
;