- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2017 03:56 AM
how to set numeric value for a variable in service catalog like mobile number...
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2017 10:50 PM
You can use this an onchange client script to only accept numeric. If user is trying to write non numeric value then error occurs: Please enter numeric values only in the phone number field
function onChange(control, oldValue, newValue, isLoading) {
if (!isLoading) {
if(newValue != '') {
//check to see if there are any non numeric characters in the string
if(isNaN(newValue) == true) {
alert("Please enter numeric values only in the phone number field");
g_form.setValue('phone_number', '');
}
}
}
}
And you can set max lenght to 10 from variable's default value field -> Variable attributes : max_lenght=10
Thanks,
Joonas
please like or mark correct based on the impact of response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2017 04:08 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2017 10:20 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2017 10:32 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2017 10:36 PM
but it should only accept integer and length of integer should be 10
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2017 10:50 PM
You can use this an onchange client script to only accept numeric. If user is trying to write non numeric value then error occurs: Please enter numeric values only in the phone number field
function onChange(control, oldValue, newValue, isLoading) {
if (!isLoading) {
if(newValue != '') {
//check to see if there are any non numeric characters in the string
if(isNaN(newValue) == true) {
alert("Please enter numeric values only in the phone number field");
g_form.setValue('phone_number', '');
}
}
}
}
And you can set max lenght to 10 from variable's default value field -> Variable attributes : max_lenght=10
Thanks,
Joonas
please like or mark correct based on the impact of response
