Quick/Embarrasing Form Submission Question

J

Jeff

I have a form that is passed to a subroutine when a button is pressed
via the button's 'onClick' property. That works peachy. However, while
testing I submited the form by hitting enter instead of pressing the
button. In this situation, the subroutine isnt called and nothing is
accomplished.

My question is this: how can I call the subroutine from the form so
that any/all submission events are directed to the subroutine? Before
you mention the 'onSubmit' event, I will also add that I tried that
with no luck.

<form onsubmit="SubmitHandler" runat="server">
...lots of controls...
<asp:Button id="SubmitBtn" onclick="SubmitHandler" runat="server"
Text="Submit" />
</form>
 
D

dbottjer

You can change the button from an ASP:Button to a input type=Submit Then make
your page load call function the ASP:Button would have.
 

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
473,774
Messages
2,569,599
Members
45,177
Latest member
OrderGlucea
Top