PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

How to forced text field incorrect entry as error

  1. UT RadOnc
    Member

    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.

    Posted 11 years ago on Monday February 4, 2013 | Permalink
  2. David Peralty

    This can only be done via PHP coding.

    Posted 11 years ago on Monday February 4, 2013 | Permalink
  3. UT RadOnc
    Member

    Okay, thanks very much for getting back to me, David.

    (P.S. Not sure where "flat" came from in my title. Supposed to be "forced".)

    Posted 11 years ago on Tuesday February 5, 2013 | Permalink