04-14-2014 03:27 AM
Hi,
When using a message popup how best can validation be done?
I need to check that the used has entered 3 letters.
Thanks
Simon
04-14-2014 03:57 AM
Simon,
easiest solution would be to make the "sanity" check in a code module which also is the popup. Depending on the parameters of the check, you should pass appropriate values to the module.
Norbert
04-14-2014 06:20 AM - edited 04-14-2014 06:22 AM
If you use the standard "Message Popup" step you can determine the length of the user input within the Step's Post-Expression.
Say you create a Local variable "input_valid" and use the following post-Expression in the Message Popup step:
Len(Step.Result.Response) == 3 ? (Locals.input_valid = True) : (Locals.input_valid = False)
Then you can expand from there with e.g. a while loop around the Message Popup.
This does not quite fulfil your requirement though as it only checks for the length of the user input and not whether it has three letters.Could as well be two letters and a number. But maybe that is already good enough for you, in this case you wouldn't need a code module.
04-14-2014 08:46 AM
Hi,
Thanks for the reply’s.
I was hoping to stay away from a code module to check, feeling a bit lazy, so the minimum 3 charter entry is a start for the moment untill I get around to a more comprehensive check.
Thanks
Simon