Multiple forms
Posted: Thu Dec 11, 2008 9:36 pm
I have a loop that extracts data out of the database and outputs a dropdown form with each line with options for the user. I have included an onChange = "this.form.submit();" for each dropdown. This works fine in Firefox, but does not work so well in Internet Explorer(yes, scripting is enabled). Here's the code:
This code is then just echo'd for each line. $variable 1 and $variable2 are unique, so to name each form differently I just give combine the two for a unique name I can call at some.php.
Symptoms: In Mozilla this works great. With IE(both 6 and 7) the variable1 and variable 2 are passed along, however option_1(the 1st default option displayed) is always passed along except for the last one of my list. The last one of the list always passes along the correct the correct value.
So if I had two outputs A and B,and I selected Option2 for each of them...then A would send Option1 but B would send the selected Option2.
Code: Select all
$statusMessage = '<form method="post" action="some.php">
<input type = "hidden" name ="variable1" value ="'.$variable1.'"' />
<input type = "hidden" name ="variable2" value ="'.$variable2.'"' />
<select name = "'.$variable1.$variable2" onChange = "this.form.submit();">
<option value = "option_1"> Option 1</option>
<option value = "option_2"> Option 2</option>
<option value = "option_3"> Option 3</option>
<option value = "option_4"> Option 4</option>
</form>';
Symptoms: In Mozilla this works great. With IE(both 6 and 7) the variable1 and variable 2 are passed along, however option_1(the 1st default option displayed) is always passed along except for the last one of my list. The last one of the list always passes along the correct the correct value.
So if I had two outputs A and B,and I selected Option2 for each of them...then A would send Option1 but B would send the selected Option2.