How do you limit a variable to 10digits?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2022 12:06 PM
Hi, The requirement is> minimum of 10 digits is required for a variable.
Is this the correct script?
Here is the script. I created a on change script.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var val = g_form.getValue('Facility_npi');
var pattern = /\d{10}/;
if (pattern.test(val))
alert('looks like 10 digits');
else
Labels:
- Labels:
-
Scripting and Coding
15 REPLIES 15
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2022 11:20 AM