I'd like to use jQuery validation to validate a field that only accepts number and punctuation marks, but there doesn't seem to be a defined rule for it. I've searched google but I've found nothing useful.
Any ideas?
Appreciate your help.
I'd like to use jQuery validation to validate a field that only accepts number and punctuation marks, but there doesn't seem to be a defined rule for it. I've searched google but I've found nothing useful.
Any ideas?
Appreciate your help.
In the rules object you can do the following:
rules: {
yourField:{
regex: /^[0-9!?.;,]+$/
}
}
You can add the punctuation marks you want to that regex.