How is the dropdown HTML code generated, i.e. is it dynamic or static? The general idea would be: for each option in the dropdown, check if that option's value is equal to the value the user previously selected and, if it is, output the necessary HTML (e.g. selected="selected") to make that option be selected by default.