Adding warning/error messages to my form

  • gemai
    Asked on October 22, 2015 at 10:17 PM

    Hi there

    To ensure data quality, I'd like to add a few validations in my form. For example, I have a text field and I want it to be filled in a particular format (i.e. EMP99). So, if the user types '67' instead of 'EMP67', I want a message saying: 'The format of this fields should be EMP99'. Is it possible such a thing?

    Cheers

        Gema

  • Sammy
    Replied on October 23, 2015 at 5:49 AM

    Hi Gema,

    At the moment it is not possible to customize warning message for each individual form field.

    You can however use an input mask to enforce the required format, you can create the mask in such a way the word EMP is already pre-filled and what the user needs to do is just enter the number.

    User a normal text box and then set the input mask, you can then turn on the mask validation to ensure only a number is entered.

    Adding warning/error messages to my form Image 1 Screenshot 30

    Here is a preview of the outcome.

    Adding warning/error messages to my form Image 2 Screenshot 41

  • gemai
    Replied on October 28, 2015 at 8:41 PM

    Hi Sammy

    I've tried what you suggested. My input mask is EMP-***. All good in the data entry but when I go to the Google sheet, I see things like EMP-1__, EMP-78_, EMP-987. Obviously, the last one is perfect but the other two should be EMP-1 and EMP-78.

    Thoughts?

  • Sammy
    Replied on October 29, 2015 at 1:54 AM

    Hi Gema,

    It appears the normal text-field with the mask pattern will pas the (_) when the entire mask field is not filled in.

    You can use the masked input widget which will not append the line when you submit single value digits.

    Adding warning/error messages to my form Image 1 Screenshot 50

    Set it up as outlined in the screenshots below.

    Adding warning/error messages to my form Image 2 Screenshot 61

    Scroll down to the bottom to access the following options.

    Adding warning/error messages to my form Image 3 Screenshot 72

    Upon submission the data will be as follows

    Adding warning/error messages to my form Image 4 Screenshot 83

    Please let us know if this addresses your situation.

  • gemai
    Replied on November 2, 2015 at 5:55 PM

    Hi Sammy 

    Thanks for your suggestion. I've just tried the Masked Input widget and, although it solves my problem, it creates another one: a space between my prefix (i.e. EMP) and the number. Is there any way of getting rid of the space?

    Cheers

        Gema

  • Sammy
    Replied on November 3, 2015 at 1:00 AM

    Hello Gema,

    Unfortunately it seems the space is a default for the mask widget.

    We can however use form conditions to achieve the same, here's the approach.

    1. create a text-field to take the three digit numbers only

    2. Use conditions to update a second field with the text and suffix added.

    Adding warning/error messages to my form Image 1 Screenshot 60

    Adding warning/error messages to my form Image 2 Screenshot 71

    Click on add field to specify the whose value you want prefixed to the name EMP-

    Adding warning/error messages to my form Image 3 Screenshot 82

    Adding warning/error messages to my form Image 4 Screenshot 93

     

    Here is the final outcome

    Adding warning/error messages to my form Image 5 Screenshot 104

  • gemai
    Replied on November 3, 2015 at 4:57 PM

    Thanks Sammie. That will work.