How to add validation to your kiosk fields

If you are getting inconsistent content from your kiosk survey, you might consider validating some of the user input.

Some fields in the kiosk module allow you to validate the content the guest is submitting. 

There are fields that do this automatically, like the email field. This field will always require an email format like "support@bmileisure.com". Here the input will always validate for the following mask "*@*.*".

Now, what are masks? Masks enable us to tell the field there are minimum requirements or limitations on what can be filled in. You need to know some mask elements to make these masks. 

These are the most commonly used ones.

  • 0: Digit, required. This element will accept any single digit between 0 and 9.
  • 9: Digit or space, optional.
  • C: Character, required.
  • c: Character, optional.
  • A: Alphanumeric, required.
  • a: Alphanumeric, optional.
  • L: Letter, required. Restricts input to the ASCII letters a-z and A-Z.
  • l: Letter, optional. Restricts input to the ASCII letters a-z and A-Z. 
  • .: Decimal placeholder. The actual display character used will be the decimal symbol appropriate to the format provider.
  • /: Date separator. The actual display character used will be the date symbol appropriate to the format provider.
  • >: If a > character appears in the mask, all the characters that follow it are converted to uppercase until the end of the mask or until a < character is encountered.
  • <: If a < character appears in the mask, all the characters that follow it are converted to lowercase until the end of the mask or until a > character is encountered.
  • All other characters: Literals. All non-mask elements will appear as themselves. Literals always occupy a static position in the mask at run time, and cannot be moved or deleted by the user.

So in clear examples, you can use the following masks:

  • asking for a date input: 00/00/0000
  • asking for a Zip code in US format: LL 00000
  • asking for a phone number: (000) 000-0000

 

How to apply a mask

To apply masks you need to

  • navigate to the survey and open the field details.
  • Created the required mask in the mask field. 
  • you might want to put an example in the placeholder field to make it clearer.
    this will be shown in the field for the guest
  • Now the guest will only be able to fill in the input according to the mask.