I have a form with multiple SELECT drop-down menus. Each menu can submit the form using the onChange function. How can I determine which of the drop-down menus was used to submit the form?
<form method="post" enctype="multipart/form data" action="submit.php"> <select name="one" onChange="submit()"> <option value="1">1st choice</option> <option value="2">2nd choice</option> </select> <select name="two" onChange="submit()"> <option value="1">1st choice</option> <option value="2">2nd choice</option> </select> </form>
I know the selected values are passed to submit.php in the $_POST variable, but I also need to detect which of the two menus was used to submit the form (the form may be loaded with any combination of values pre-selected). How can I do this? Thanks!
PS: I think the best way would be to call a different submit URL for each onChange like "submit.php?source=one" and "submit.php?source=two", but I don't know how to use a different URL for each onChange=submit(). Are there parameters that can be passed when calling the "submit()" function?
Edited by void64: more info