Problems with JavaScript submit()

X

Xeon

Hi,

I have this HTML code:

<form method="post" action="foo.php">
<select name="blah" onChange="javascript:submit();">
<option selected value="1">opt1</option>
<option value="2">opt2</option>
<option value="3">opt3</option>
<option value="4">opt4</option>
</select>
<input type="submit" name="sub1" value="Submit 1">
<input type="submit" name="sub2" value="Submit 2">
<input type="submit" name="sub3" value="Submit 3">
</form>

Now, if there is a change on the drop-list, the form is submitted, but
the value read on the submitted form won't change from the previous
value. Say, if the previous value of the drop-list is 'opt1', then I
change it to 'opt3'. The form is submitted, but the the submitted
value is still 'opt1'. So how do I rectify this? This behaviour won't
occur when the form is submitted by clicking any of the submit
buttons(Submit 1, 2, 3).

Any help appreciated
TIA
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,077
Messages
2,570,566
Members
47,202
Latest member
misc.

Latest Threads

Top