Hi All,
In FSM mobile can we check if in the field user is adding an alphanumeric value and trying to save to thrown an exception to add only numeric data. Is it possible using client script.
Thanks,
Lavanya
Hi All,
In FSM mobile can we check if in the field user is adding an alphanumeric value and trying to save to thrown an exception to add only numeric data. Is it possible using client script.
Thanks,
Lavanya
var inputValue = getControlValue("custom",”barcode”);
var vLength = getDBValues(stringFormat("SELECT LENGTH('{0}') AS len FROM task WHERE task_id = (SELECT MIN(task_id) FROM task)", inputValue));
var j = "";
var x = "";
for (var i = 1; i <= vLength0] "len"]; i++)
{
j = getDBValues(stringFormat("SELECT SUBSTRING('{0}', {1}, 1) AS char FROM task LIMIT 1", getFromCache("isNumeric"), i ));
x = "a" + j 0];"char"];
if (x != "a0" && x != "a1" && x != "a2" && x != "a3" && x != "a4" &&
x != "a5" && x != "a6" && x != "a7" && x != "a8" && x != "a9" &&
x != "a." )
{
return "0";
}
}
return "1";
You can run the above script using the executeScript function. It returns 1 if the input is a numeric value. Otherwise it returns 0.
Thanks.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.