Skip to main content
Question

FSM Mobile prevent newline

  • January 2, 2025
  • 1 reply
  • 20 views

Forum|alt.badge.img+7

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.

1 reply

Forum|alt.badge.img+7
  • Author
  • Do Gooder (Customer)
  • January 2, 2025

Actually just started working. No idea why.