Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-17-2018 08:27 PM
This is my phone validation client script;
I need to change it in a way so it accepts international numbers as well. Any thoughts pls?
Solved! Go to Solution.
1 ACCEPTED SOLUTION

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-17-2018 09:53 PM
Hello Sonita,
The given script might help you out. Let me know in case of any issue.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var regex = /^[a-zA-Z0-9\-().\s]{10,15}$/;
if (regex.test(newValue)) {
g_form.addInfoMessage("Valid international phone number ");
} else {
g_form.addInfoMessage("Invalid international phone number ");
g_form.setValue("u_phone","");
}
}
Thank you!
1 REPLY 1

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-17-2018 09:53 PM
Hello Sonita,
The given script might help you out. Let me know in case of any issue.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var regex = /^[a-zA-Z0-9\-().\s]{10,15}$/;
if (regex.test(newValue)) {
g_form.addInfoMessage("Valid international phone number ");
} else {
g_form.addInfoMessage("Invalid international phone number ");
g_form.setValue("u_phone","");
}
}
Thank you!