We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

Field should only accept numeric value

SNow35
Giga Guru

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

1 ACCEPTED SOLUTION

saprem_d
Tera Guru

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


    }


}


View solution in original post

11 REPLIES 11

I used the correct syntax it didnot work


Try writing a simple onload client script on the same table and check if is working.