Skip to main content

In FSM mobile how do I prevent engineers from entering a newline/carriage return in a text field?The below works for other undesired characters…

var myField = getControlValue('CUSTOM', 'TEST_TEXT');
var isInvalidChar = getDBValue(stringFormat("SELECT CASE WHEN '" + myField + "' REGEXP '^'A-Za-z0-9\-\\\/]+$' THEN 'FALSE' ELSE 'TRUE' END AS isInvalidChar;"));

Essentially we are capturing a serial id which can contain 0-9, a-z, A-Z, hypen, backslash and forwardslash. Anything else should fail.

Actually just started working. No idea why.


Reply