JQuery Field Validation
Posted: 05 Dec 2014
I would like to use the following to validate a text field but I'm currently unable to get it to work in FormsDesigner:
$('fd.field[fd_name="Address_x0020_1"]').change(function() {
var pattern = new RegExp('[PO.]*\\s?B(ox)?.*\\d+', 'i');
if ($(this).val().match(pattern)) {
alert('No PO Boxes');
}
});
$('fd.field[fd_name="Address_x0020_1"]').change(function() {
var pattern = new RegExp('[PO.]*\\s?B(ox)?.*\\d+', 'i');
if ($(this).val().match(pattern)) {
alert('No PO Boxes');
}
});