How to stop the onclick function running when onsubmit validation fail
Usera User
Greenhorn
Joined: Jul 13, 2005
Posts: 21
posted
0
I have a onsubmit() function in form tag for validating the required fields and I also have a onclick() function on the submit button for disable the button. How to stop the onclick function running when the validation function find the some required fields are empty ?
I have a problem that when user submit the form, the onsibmit function finds that some fields have not filled, and then the onclick function disable the button ! So that user cannot re-submit the request.
Thanks
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15357
6
posted
0
why don't you have the onsubmit handler disable the button and not the onclick handler?
Eric
Usera User
Greenhorn
Joined: Jul 13, 2005
Posts: 21
posted
0
Because I am using the struts validator. The onsubmit function is generated by the validation framework.
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.
subject: How to stop the onclick function running when onsubmit validation fail