|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Quick/Embarrasing Form Submission QuestionI 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> 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. Show quoteHide quote "Jeff" wrote: > 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> > >
Bound dropdownlist in .NET 2.0 -- picking the selected value?
master-pages: naming problem for client-side scripting Button Click event not firing GridView Multi Select ? referencing and anchor from within a usercontrol (ascx) How to filter file types when using the HTMLInputFile control... Viewing Composite Controls at Design Time Hide SideBar of Wizard Control Custom type converter Table - no ViewState |
|||||||||||||||||||||||