- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2016 09:18 AM
I have a string field but i should limit it such that only numeric values can be entered. Does anyone know how to do this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2016 09:39 AM
Hi Shalini ,
write a onChange(0 client script on field:
here I am explaning that EmpAge should read only digit not characters
i have field Empage of type strin but reads only digits
script:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
//Type appropriate comment here, and begin script below
var age=g_form.getValue('u_emp_age');
if (isNaN(age))
{
alert("Age should be in Digits");
g_form.setValue('u_emp_age','');
return false;
}
}
Thanks
Pradeep D J
PS - Please mark Helpful, Like, or Correct Answer if applicable.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2016 09:30 AM
Write a Onchange Client Script to check the input using Use Reg Exp.
var str = g_form.getValue('field_name');
var regexp = /[0-9]/;
str.match(regexp);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2016 09:32 AM
Hi Deep
Where do i use this? Suppose my field name in 'number', where exactly should the above expression be given? Thanks for your help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2016 09:35 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2016 09:39 AM
Hi Shalini ,
write a onChange(0 client script on field:
here I am explaning that EmpAge should read only digit not characters
i have field Empage of type strin but reads only digits
script:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
//Type appropriate comment here, and begin script below
var age=g_form.getValue('u_emp_age');
if (isNaN(age))
{
alert("Age should be in Digits");
g_form.setValue('u_emp_age','');
return false;
}
}
Thanks
Pradeep D J
PS - Please mark Helpful, Like, or Correct Answer if applicable.