Form on a page has a select (dropdown) listing US states and abbreviations. "Value" holds state 2-letter abbreviations.
Form gets submitted to another page for processing.
May need to go back to the page with the originating form, and would like to set the <select>, but is is set with the text
, not the value
$qsstate = ($_GET['varstate']);
<select id="state" name="state" size="1">
<option selected value="<?php echo $qsstate; ?>"></option>
When the form is submitted, "AZ" is posted if the user selected "Arizona."
So, on the processing page, I don't have the word "Arizona", just "AZ", and if that is sent as the querystring variable (varstate), it does not set the select option to "Arizona"
I know, it's only 50 states... I could have a lookup on the processing page to lookup AZ and send back "Arizona" in the querystring. But wondered if there is another way.
Thanks in advance!