- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2023 07:22 AM
I created a variable and gave type as single line text. In this i want this variable field to be restricted to only numeric characters.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2023 07:29 AM
You can use single line text type to create a number type field .
There is no such a specific type for number field
If my answer solved your issue, please mark my answer as ✅Correct & 👍Helpful based on the Impact
Thanks,
Manjusha Bnagale
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2023 07:41 AM
I wanted to tell you to create a variable of type single line text which you already created
Check below code to allow user to enter numeric value only for your single line field
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var regexp = /^[+]?\d*$/;
if(!regexp.test(newValue)){
alert('Please enter numeric value');
g_form.setValue('v_sec_review_unknown','');
}
}
in addition I defined "variable attributes max_length=3" to accept up to 3 digits
Refer below source-
You can also Refer:
Thanks,
Manjusha Bangale
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2023 07:29 AM
You can use single line text type to create a number type field .
There is no such a specific type for number field
If my answer solved your issue, please mark my answer as ✅Correct & 👍Helpful based on the Impact
Thanks,
Manjusha Bnagale
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2023 07:31 AM
How to create number type with single line text field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2023 07:41 AM
I wanted to tell you to create a variable of type single line text which you already created
Check below code to allow user to enter numeric value only for your single line field
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var regexp = /^[+]?\d*$/;
if(!regexp.test(newValue)){
alert('Please enter numeric value');
g_form.setValue('v_sec_review_unknown','');
}
}
in addition I defined "variable attributes max_length=3" to accept up to 3 digits
Refer below source-
You can also Refer:
Thanks,
Manjusha Bangale
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2023 07:58 AM
Thanks Manjusha