Page 1 of 1

JavaScript Button Validation

Posted: Tue Nov 25, 2003 9:17 pm
by moonoo1974
Hi ,
I have a html form within a Php . I have three buttons of submit type iside the form . I also have 5 text fields . Depending on the button type i want to have diffrent validations . Right now i am using a onSubmit event and calling a javascript validation funtion . But this function is same for all all the buttons . I tried to call another javascript method on one of the submit buttons . But the Browser is hanging ..
Kindly let me know a way to handle this..
Regards
Deb

Posted: Wed Nov 26, 2003 12:59 pm
by Johnm
Post the code for your buttons. Call a different JS validation function for each button but make their type equal to button not submit. Then for the button, use the on click event to call your validation functions and if all is correct in the the validation put form.submit() in the function to submitthe page.

John M