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.
How to validate input value with external data?Asked by leandrodrigues14 on April 23, 2015 at 10:22 PM
How do I insert a field of "promotional code", "discount code" or "gift coupon", where one should insert a hidden default values (letters and numbers) to fill the field? The values are differents and true, but only one correct is placed.
I need put a promotional code in my form.
Hello leandrodrigues14 ,
I am not sure if I have understood your requirement correctly.
Do you want to add a hidden field in your form and set the default value of that field? You can add a normal text box in your form and hide it. You can also set the default value of that field. Please check the screenshot below:
Hope this helps.
If you meant to ask something else, do get back to us with little more detail and we will surely help you. You may also like to share a screenshot for better understanding of your requirement.
Thank you so much. But is not it.
I want that the person enter your code in the 'Promotional code' field. Several codes will be used in this field and should only be accepted codes previously established (which would be hidden in a database or registered in the field, hidden, several codes). The field 'Promotional code' is visible all time.
I'll provide 10 codes, AB01 to AB10. Person 'A' has the AB02 code to be entered in the field and accepted. The person 'B' provided on the form the code 1234 and could not continue with the inscription because her provided an invalid code.
I want to do it.
The field 'Modalidade de inscrição' is conditional. Marking the 'Código promocional' field comes another field to enter the correct code.
Thank you for detailed explanation.
Unfortunately we do not have such features. It is currently not possible to validate the input from any external sources.
One possible solution is to add conditions in form to match the input value. Please check the screenshot below:
If you want one "Promotional code" to be used only once, it is possible to achieve it. You can set your form limits and make the "Promotional code" field an "Unique Question" which will not allow the same code to be used more than once. The following guide should help you: http://www.jotform.com/help/223-How-to-set-Form-Limits-Based-on-a-Unique-Question
Hope this helps.
Do get back to us if you have any questions.
Another alternative is to download your form's source code and your own code to validate the input data. The following guide should help you on how to download your form's source code: http://www.jotform.com/help/104-How-to-get-the-Full-Source-Code-of-your-Form
Hi, ashwin_d, thank you again!
As your image, how do I appear at the appropriate time the message "Invalid promotional code"? In the image doesn't show this step.
I made some attempts here and wasn't good.
You should do a similar setup to show the error, but this time you check if it is filled out and if it is not equal to the codes above.
As you can see the If check is also set to ALL, because otherwise the error would have been shown all of the time.
Now, I also saw that you have set the field as hidden, so I have removed that since when you hide a field like that, it will not be possible to show it with conditions.
You can see it working in this clone of your jotform: http://form.jotformpro.com/form/51174479349970
You can also clone it to your account if you wish by following these steps: How to Clone an Existing Form from a URL
Thank you, Ben!
I couldn't able do that.
You are welcome and I am glad that you like it.
Do let us know if you have any further questions or need any assistance.
I'm very satisfied using the JotForm. Nice plataform, nice suport. Excellent!
Thank you that is always great to hear :)
As mentioned, we are always here and happy to assist so feel free to let us know when we can be of assistance :)