The onSubmit event is used to handle a submit action. But what if you have more buttons on the form and want to perform different actions depending on the button pressed? In that case you can use the onSubmitFormBtn event. It will pass the given buttonid so that you can respond depending on the button pressed.


So lets enhance the sample a bit by adding a second button and if you press that button it will reset the value.



In this sample we have set the label of the buttons. You can set it to whatever you like. To follow our sample set the buttonid gettime to 1 and the other to 2.

Create the onSubmitFormBtn event. Remove the reference to the onSubmitForm and remove code. It will look like this:


The buttonid of the reset button



The SubmitFormBtn




Of course you can play with some properties to change the look and feel of the buttons. Try to set the buttonclass and look at the result.