addressalign-toparrow-leftarrow-rightbackbellblockcalendarcameraccwcheckchevron-downchevron-leftchevron-rightchevron-small-downchevron-small-leftchevron-small-rightchevron-small-upchevron-upcircle-with-checkcircle-with-crosscircle-with-pluscontroller-playcrossdots-three-verticaleditemptyheartexporteye-with-lineeyefacebookfolderfullheartglobegmailgooglegroupshelp-with-circleimageimagesinstagramFill 1light-bulblinklocation-pinm-swarmSearchmailmessagesminusmoremuplabelShape 3 + Rectangle 1ShapeoutlookpersonJoin Group on CardStartprice-ribbonprintShapeShapeShapeShapeImported LayersImported LayersImported Layersshieldstartickettrashtriangle-downtriangle-uptwitteruserwarningyahoo

The Buffalo PHP User Group Message Board › dropDown menu onChange not working

dropDown menu onChange not working

Arnie
user 3033947
Buffalo, NY
Post #: 16
SEARCH.PHP
-------------------
if (!isset($_POST['myForm'])) {
doAAA
}
else {
doBBB
}



myFORM.HTML
-------------------

This one works just fine when I click the submit button.

<form method="post" action="search.php">
<select name="city" size="1">
...options....
<input type="submit" value="Submit" name="myForm">
</form>



But when I use an "onChange" event on the <select> so the form is automatically submitted, PHP isn't executing the correct IF statement. It's running "doAAA" when it should be running "doBBB". Anyone know how to fix this?

<form method="post" action="search.php">
<select name="city" size="1" onChange="this.form.submit­();">
...options...
<input type="submit" value="Submit" name="myForm">
</form>



Powered by mvnForum

Our Sponsors

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy