jQuery Validation
Mark Howells-Mead edited this page Oct 9, 2019
·
1 revision
- Reference documentation
- Make sure that every field which has to be validated has a
name
attribute. Otherwise, the validation result will be applied to the first field which jqueryvalidation can find in the form.
$.validator.addMethod('validTime', function(value, element) {
// 10:00:00
return /^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/.test(value);
}, 'Invalid time');
Mark Howells-Mead | https://permanenttourist.ch and https://sayhello.ch/ | Wiki since 2016
Use this code freely, widely and for free. Provision of this code provides and implies no guarantee.
Please respect the GPL v3 licence, which is available via http://www.gnu.org/licenses/gpl-3.0.html