I am using jQuery Validation plugin ( http://bassistance.de/jquery-plugins/jquery-plugin-validation/ )
I have a very odd scenario in front of me.
I have one form, with 5 different submit buttons
<form id="frm1" name="frm1" method="post" action="save.php">
------- input fields here---
<input type="submit" name="submit" value="update account info">
------- input fields here---
<input type="submit" name="submit" value="update address info">
------- input fields here---
<input type="submit" name="submit" value="update credit-card info">
------- input fields here---
<input type="submit" name="submit" value="update bank info">
------- input fields here---
<input type="submit" name="submit" value="update other info">
</form>
Now, for each submit button, I need to validate a few fields (and not all fields)
Say for “update account info” submit, I need to validate following input fields with following ids:
cust_fname
cust_lname
cust_age
Say for “update other info” submit, I need to validate following input fields with following ids:
married
childerns
How can I achieve following?
create 5 separate forms is the most easy way to do this. Then you can bind a different specific validation to each form.
Or you can bind a validation to each click on a submit button.
assuming you update your submitbutton to:
Then with jquery you can bind this with:
And do this for every button.
edit: Live has been deprecated.