ASP Form Submit on Return Key?

Associate
Joined
24 Oct 2007
Posts
55
Location
Cheltenham
Hey all,

I have a classic asp page that has 3 seperate forms and their own submit button. The problem i seem to have is when the users presses the enter key it will always submit the first form (even though they are named different & submit button named different).

Is there an easy way to only submit the form the user is currently in (each form only has one textbox input each)??
 
This problem sounds like it is more HTML than ASP. The enter key press submits the form for which the current element is part of - this is a behaviour of the browser.

If an element is submitting a form previous to that which you're expecting it to, the most likely cause is that you haven't closed the previous form properly.
 
Thanks for the reply Spunkey,

Turns out it was my fault all along as I had written some vbscript to capture ONLY the button press, forgetting that pressing enter/return doesn't hit the button but simply submits the form which the textbox is in.

A case of too much code instead of not enough!

Thanks again :)
 
Back
Top Bottom