Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form not submitting in IE7

Status
Not open for further replies.

emozley

Technical User
Jan 14, 2003
769
GB
Hi,

I've got a page with nothing on apart from the following

<form method="get" action="test.asp" onClick="submit()" name="Form">
<select class="text2" name="criteria">
<option value="BWB">BWB Diary</option>
<option value="Training">Training Diary</option>
</select>
</form>

When I make a selection the form is submitting but the resulting querystring always says BWB regardless of which option I select. It works fine in IE6 but not IE7. Where am I going wrong?

Thanks

Ed
 
emozley, this does not work in IE6 either.
You have an onclick event in your FORM tag. As soon as you click on the form it submits. Your only current field in the form is the select field so of course clicking on that is triggering the onclick event in the form tag and the form submits with the current value of that field.



At my age I still learn something new every day, but I forget two others.
 
It could be submitting when you click on the form, before you make your selection. Try this instead:
Code:
<form method="get" action="test.asp" name="Form">
<select class="text2" name="criteria" onchange="this.form.submit()">
<option value="BWB">BWB Diary</option>
<option value="Training">Training Diary</option>
</select>
</form>

I HOPE you don't have a function named submit(). It's really not a good practice to give page elements the same names or IDs as the tags, like you did with your form named Form.

Lee
Lee
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top