I want to be able to force an error status on a text field if the person doesn't enter one of a number of specific entries, so that the form cannot be submitted while the entry is incorrect.
This will be for a promotional code. I don't want to put this into a radio button field, since the person must know the code in order to enter it (not choose it from multiple choice). I can have it flagged as required, but I want to test if what is entered is "promo-one" or "promo-two" specifically, and if it's not, to flag it as an error so that the form can't be submitted yet.
I've created a feedback message system to let the person know if their code is correct. (Using two HTML fields - one displayed "Promo code required" if the field doesn't match one of the codes, and the other HTML field displays "Thx for your promo code" when the code matches correctly; when one HTML field displays, the other is hidden.)
However, even if the person enters the wrong code, the form can still be submitted. Is there a way to deny submission of the form if the promo code field is incorrect, or even if the "Promo code required" field is still visible (or the "thx" field is not visible)?
This needs to be done through the form builder view (not by adding PHP coding).
Thanks very much for help with this.