PHP and Select Dropdown Loses Setting Our order form for name, address, etc. contains PHP-handled dropdown lists for selecting state and country. If, on "Submit", the user has selected "State", say, but missed a required field, e.g. "City", an error message is displayed alongside "City". The state selection is undisturbed. Standard stuff so far.
But now the user types in the city, presses "Submit" again, and the form is this time re-displayed with "State" showing "0". That is, on this second "Submit" the state selection is lost. Can anyone see what we are doing wrong?
Many thanks for having a look. Here's the code for "State" (with list trimmed for brevity):
* State
'; ?>
if ((isset($_POST['submit2'])) && (($_POST['State']) == "0")) { echo "* Please include your State.\n"; } ?>
Started By scwilson on May 22, 2006 at 12:28:10 PM