i have several HTML Select dropdowns on the same page, used in slightly different contexts. they both use the same option data that is stored and echoed out of a php variable that was built from a database query.
The Problem i am running into is that one works and returns the selected value, while the other one only returns the value of the first option.
this is my markup for the one that works
<select name="Home_State" id="Home_State">
<?php echo $states;?>
</select>
the options for the one that works
<option value="1">AL</option><option value="2">AK</option><option value="4">AZ</option><option value="5">AR</option><option value="6">CA</option><option value="8">CO</option><option value="9">CT</option><option value="10">DE</option><option value="11">DC</option><option value="12">FL</option><option value="13">GA</option><option value="15">HI</option><option value="16">ID</option><option value="17">IL</option><option value="18">IN</option><option value="19">IA</option><option value="20">KS</option><option value="21">KY</option><option value="22">LA</option><option value="23">ME</option><option value="24">MD</option><option value="25">MA</option><option value="26">MI</option><option value="27">MN</option><option value="28">MS</option><option value="29">MO</option><option value="30">MT</option><option value="31">NE</option><option value="32">NV</option><option value="33">NH</option><option value="34">NJ</option><option value="35">NM</option><option value="36">NY</option><option value="37">NC</option><option value="38">ND</option><option value="39">OH</option><option value="40">OK</option><option value="41">OR</option><option value="42">PA</option><option value="44">RI</option><option value="45">SC</option><option value="46">SD</option><option value="47">TN</option><option value="48">TX</option><option value="49">UT</option><option value="50">VT</option><option value="51">VA</option><option value="53">WA</option><option value="54">WV</option><option value="55">WI</option><option value="56">WY</option>
This is my markup for the one that does not work
<select name="Mail_State" id="Mail_State">
<?php echo $states;?>
</select>
and the options for the one that does not work
<option value="1">AL</option><option value="2">AK</option><option value="4">AZ</option><option value="5">AR</option><option value="6">CA</option><option value="8">CO</option><option value="9">CT</option><option value="10">DE</option><option value="11">DC</option><option value="12">FL</option><option value="13">GA</option><option value="15">HI</option><option value="16">ID</option><option value="17">IL</option><option value="18">IN</option><option value="19">IA</option><option value="20">KS</option><option value="21">KY</option><option value="22">LA</option><option value="23">ME</option><option value="24">MD</option><option value="25">MA</option><option value="26">MI</option><option value="27">MN</option><option value="28">MS</option><option value="29">MO</option><option value="30">MT</option><option value="31">NE</option><option value="32">NV</option><option value="33">NH</option><option value="34">NJ</option><option value="35">NM</option><option value="36">NY</option><option value="37">NC</option><option value="38">ND</option><option value="39">OH</option><option value="40">OK</option><option value="41">OR</option><option value="42">PA</option><option value="44">RI</option><option value="45">SC</option><option value="46">SD</option><option value="47">TN</option><option value="48">TX</option><option value="49">UT</option><option value="50">VT</option><option value="51">VA</option><option value="53">WA</option><option value="54">WV</option><option value="55">WI</option><option value="56">WY</option>
and then getting the form value using CI
$Mail_State = $this->input->post('Mail_State');
echo $Mail_State
returns the value of the first option regardless of what option is selected.