I have a multi-page form with two php generated select boxes on the first page (they take data from a MySQL table and present it as select options). The form works perfectly on the first visit where the value to be selected in the first select box is derived from a GET value in the URL. The visitor fills in various fields and then clicks next to go to the next (and last) form in the sequence where they check their details and finally submit the form. All this works perfectly. The problem is if the details are not right and they click the back button (multi_go_back) the selected values in the two select boxes are not retained. Everything else is and if they select the box again and go forward again everything is fine. The URL of the form is shown as the name of my formmail.php script not the name of my form.php. When I examine the html of the two boxes, they look just like they would if they had been hard-coded. I've checked for the usual problems such as not having value="" and spaces in the value, but they are not the problem. I even commented out my GET statement so nothing is selected in the box on the first visit. Again no difference.

The form seems to be being regenerated by Formmail when the user goes back, since I've made minor tweaks to the form before going back to it and they show in the form. I've tried hard-coding the php variable that is used to make the selection on the first visit. It doesn't do anything on the return to the form. I've disabled this and put in two hard-coded options in the select box and as long as I select one of these, the form does get repopulated correctly.

I've search in vain through these forums for an answer, but haven't found anyone having this problem or any hint of a solution to it. I'm wondering if the php is being executed after the form has been repopulated. If that is so, how can I get access to the values of these two fields in order for php to use them in rebuilding the select boxes? If not, what else could be causing the problem?