JavaScript Button Validation

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
moonoo1974
Forum Newbie
Posts: 1
Joined: Tue Nov 25, 2003 9:17 pm

JavaScript Button Validation

Post 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
User avatar
Johnm
Forum Contributor
Posts: 344
Joined: Mon May 13, 2002 12:05 pm
Location: Michigan, USA
Contact:

Post 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
Post Reply