- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-05-2017 12:55 AM
Hi All,
I have a variable which is single line text, this should only accept numeric values. Please let me know how I can achieve this.
Thanks,
Shugufta
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-05-2017 01:05 AM
Hi,
Write an onChange client script. One sample is below
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var numnericVal=g_form.getValue('your field name');
if (isNaN(numnericVal)) // check if value is not numeric
{
alert("Please enter numeric values");
g_form.setValue('your field name', ''); // Set the field to empty
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-05-2017 01:00 AM
you can put onchange client script which will check for the number.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-05-2017 01:00 AM
Hi,
You can write script for achieving this. Below link will help you to find exact script:
Can i force a from field to only accept numeric value?
String field to accept only numeric values
Please mark Correct/Helpful as per impact of the response!!
Thanks,
Anjali
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-05-2017 01:05 AM
Hi,
Write an onChange client script. One sample is below
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var numnericVal=g_form.getValue('your field name');
if (isNaN(numnericVal)) // check if value is not numeric
{
alert("Please enter numeric values");
g_form.setValue('your field name', ''); // Set the field to empty
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-26-2017 01:38 AM
Hi,
when I use showErrorMessage instaed of alert it is not giving me the error message.
Thanks & Regards,
Shugufta.