I have a select list where the option values are populated from a MySQL database. I use this select list to update the rest of the values on the page. I have it updating using a onchange event just fine, but when that happens the value of the option changes back to the default. Any ideas on iterating through the values to write selected on that option?
Thanks,
Sky
Place the above code between <select> and </select>. You have to have an array to hold each option-value/caption pair. Note that $selected determines whether or not the option is to be selected, based on the value $_GET['option_val']. I used $_GET, but it can of course come from the database, your config file, etc.