Hi all, I have a form drop down box (for the 50 states) that is populated via a PHP for loop (see code below). The user selects a residential state, then later in the form also has to select a mailing state (in case the two are different). I have provided a check box in JavaScript that, when checked, populates all the mailing information with the information that has already been entered in the residential information section. When that box is checked all the mailing information fields except the mailing state are disabled and read same as residential information
. The mailing state does not read same as residential information
because I did not populate it with that option. Is there some way I can populate my drop down box with that option so the user cannot see it, but it will still be available when I want to use it in the code?
<label>Residental State</label><br/>
<select id="res_state" name="res_state">
<?php
$states = array('Select State' , 'AA' , 'AE' , 'AK' , 'AL' , 'AP' , 'AR' , 'AS' , 'AZ' , 'CA' , 'CO' , 'CT', 'DE' , 'DC' , 'FL' , 'FM' , 'GA' , 'GU' , 'HI' , 'IA' , 'ID' , 'IL' , 'IN' , 'KS' , 'KY' , 'LA' , 'MA' , 'MD' , 'ME' , 'MH' , 'MI' , 'MN' , 'MO' , 'MP' , 'MS' , 'MT' , 'NC' , 'ND' , 'NE' , 'NH' , 'NJ' , 'NM' , 'NV' , 'NY' , 'OH' , 'OK' , 'OR' , 'PA' , 'PR' , 'PW' , 'RI' , 'SC' , 'SD' , 'TN' , 'TX' , 'UT' , 'VA' , 'VI' , 'VT' , 'WA' , 'WI' , 'WV' , 'WY');
for($i = 0; $i < count($states); $i++){
echo "<option>$states[$i]</option>";
}
?>
</select>