GezH
Programmer
- Aug 7, 2002
- 68
Hello.
I am making changes to a JSP page with javascript validation via JQuery. Currently the validate method defines a number of rules, for example:
rules: {
"card.cardName": "required",
"card.cardType": "required"}
},
messages: {
"card.cardName": "Please enter the name on the card",
"card.cardType": "Please select a card type"}
}
I want to add some extra rules for new form fields which I have added. However, I only want this validation to happen if a certain checkbox is checked. I've not used JQuery before, so I don't know if this is possible or how I could do it?
Any advice greatly appreciated.
I am making changes to a JSP page with javascript validation via JQuery. Currently the validate method defines a number of rules, for example:
rules: {
"card.cardName": "required",
"card.cardType": "required"}
},
messages: {
"card.cardName": "Please enter the name on the card",
"card.cardType": "Please select a card type"}
}
I want to add some extra rules for new form fields which I have added. However, I only want this validation to happen if a certain checkbox is checked. I've not used JQuery before, so I don't know if this is possible or how I could do it?
Any advice greatly appreciated.