What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.
At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.
We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.
Adding warning/error messages to my formAsked by gemai on October 22, 2015 at 10:17 PM
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?
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.
Here is a preview of the outcome.
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.
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.
Set it up as outlined in the screenshots below.
Scroll down to the bottom to access the following options.
Upon submission the data will be as follows
Please let us know if this addresses your situation.
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?
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.
Click on add field to specify the whose value you want prefixed to the name EMP-
Here is the final outcome
Thanks Sammie. That will work.