- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2017 05:36 AM
Hi team,
How to allow integers & decimal numbers in string field and avoiding alphabets
Thanks,
Rajashekhar Mushke
Rising star : 2022 - 2024
Community Leader -2018
Connect me on LinkedIn : Rajashekhar Mushke
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2017 06:14 AM
This this instead. The RegEx in the other example is incorrect.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var regexp = /^[\d\.]+$/;
if(!regexp.test(newValue)) {
alert('Only numbers and dot allowed');
g_form.setValue('u_fieldname','');
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2017 06:02 AM
You can enter them, but as soon as you go to another field, the onChange script triggers and does the evaluation, throwing an error.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2017 06:08 AM
No, i have updated record as well.
Thanks,
Rajashekhar Mushke
Rising star : 2022 - 2024
Community Leader -2018
Connect me on LinkedIn : Rajashekhar Mushke

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2017 06:14 AM
This this instead. The RegEx in the other example is incorrect.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var regexp = /^[\d\.]+$/;
if(!regexp.test(newValue)) {
alert('Only numbers and dot allowed');
g_form.setValue('u_fieldname','');
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2022 11:21 AM
Hi Chuck,
Thank you for the solution. I've used it and it's been working well. Quick follow up..
How would I get it to allow negative integers. At the moment this rule is blocking me from entering a number like -20? The negative symbol seems to be blocked. Is there a way to add an exception.
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2023 10:02 PM
Hi, Chuck.
May I know which table to use? Thank you.