Phone Number Valadation
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
Hello,
You can validate user input with a regular expression. Sample:
You can validate user input with a regular expression. Sample:
Code: Select all
fd.field('Title').change(function() {
var patt = /^\(\d{3}\) \d{3}-\d{3} x\d{4}$/g;
if (!patt.test(fd.field('Title').value())) {
alert('Incorrect phone number');
}
});
-
- Information
-
Who is online
Users browsing this forum: No registered users and 18 guests