• peaces

    (@peaces)


    How can I set up a text field so that only one of three typed in alpha/numeric code will be accepted.

    I have a form where users are redeeming a coupon for a product and only 3 specific codes are good. If they don’t type in one of the specific codes I don’t want the form to submit.

    Can this be done? If yes, how do I create it?

    Thanks in advance.

    http://wordpress.org/extend/plugins/wordpress-form-manager/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter peaces

    (@peaces)

    May I edit my post… I understand how to create a new validation for my text field. My question is can I have 3 possible validation codes for a single validation field? If yes, how are they seperated in the validation setup?

    Plugin Author hoffcamp

    (@hoffcamp)

    This can be handled with regular expressions. Its actually a really powerful language, so when you have time you should Google it.

    What you want is to separate your codes with ‘|’, which stands for ‘or’. So if your three codes are ‘abc’, ‘def’, and ‘ghi’:

    /^abc|def|ghi$/

    Thread Starter peaces

    (@peaces)

    Perfect… that is exactly what I was looking for.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘[Plugin: WordPress Form Manager] Validate Text Field’ is closed to new replies.