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 setup conditions to validate the input with containg a text?Asked by MaidCrew on November 28, 2016 at 01:49 PM
Hello... I'm confused.
I have a form with a text field that is not required to be answered or filled in.... so it's optional.
If the user opts to fill it in I want to validate their answer with a text field / message that "shows" IF their answer is found contained in the value field under a show/hide condition.
If the user opts to fill it in I also want to indicate that their answer is not valid by also "showing" a different message if their answer IS NOT FOUND contained in the field by way of a "Does Not Contain" state within the condition.
The field will be able to accommodate multiple different correct answers, so the "value" entered by the users will vary. A correct answer could be "1234abc" or "abcde112233" (character lengths of the value will vary).
Due to the value (input) needing to allow for varied character lengths, I cannot apply an input mask to validate the user's answer.
Since I cannot apply an input mask to validate, how do I prevent my message "Your answer is inaccurate" from remaining visible if the user opts NOT to answer the question? The field or question, while remaining empty or unanswered, meets the condition to show text "Your answer is inaccurate". If the user answers, and their input is correct the "Your answer is inaccurate" disappears and instead the text "You've answered correctly" becomes visible.
Is this fixed through some other type of condition?.... like adding a secondary, single, label-less checkbox that says "Apply" or "Submit Answer" and then add a secondary condition requirement?
example: if field does not contain (correct) value AND if checkbox "apply" is checked, THEN show "your answer is inaccurate"
I'm sure there's a simplier answer to this that I'm totally missing.
thanks in advance!
I believe that you are looking for a solution as displayed below:
If so, you can setup the condition as shown in the screenshot below:
Here is the cloned version of your test form with the above condition that you may test it.
Please feel free to clone the form to your account. Let us know if you are referring something different. We will be happy to assist.