• Resolved broadsighted

    (@broadsighted)


    Hello, how can I configure Forminator to throw an error when certain strings of text are input? For example:

    • If Name field contains “@”
    • If Email field contains “mailinator”
    • If a textarea field contains “lorem ipsum”
Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi@broadsighted

    I hope you are doing great today. The validation feature(s) you are requesting for is not currently available on the latest version of Forminator plugin. However, this might be achievable with custom code. The support team will reach out to you on that soon(if that’s achievable).

    kind regards,
    Olumide Akintunde

    Plugin Support Williams – WPMU DEV Support

    (@wpmudev-support8)

    Hi @broadsighted

    I hope you’re well today!

    You can use combination of additional HTML fields and custom visibility rules for that.

    Let me describe example for the name field, let’s say it’s “name-1” field:

    1. add a HTML field directly below or above that name field
    2. put your error message in the HTML field
    3. set “Visiblity” rule for that HTML field as follows

    “Show this field if all of the following rules match”

    and add condition

    Field: name-1 (choose your name field to be checked here)
    Condition: Contains
    Value: @

    4. apply changes
    5 now click on the “Submit” fiedl and switch to its “Visibility” settings
    6. set rule as follows:

    Hide this field if Any of the following rules match

    and add condition

    Field: name-1 (again, select your name fiedl)
    Condition: contains
    Value: @

    7. apply changes, update the form

    And that’s it. If you put @ character in name fiedl the HTML field will become visible showing your custom error message and “Submit” button will get hidden, making it impossible to submit the form.

    You can do the same with other fields on the form.

    I also created an example form for you so you could see how it works. You’ll find it here

    https://pastebin.com/qg4zj1nj

    so you can import it to your site, test and see how it’s configured exactly.

    Best regards,
    Adam

    Plugin Support Nebu John – WPMU DEV Support

    (@wpmudevsupport14)

    Hi @broadsighted,

    We haven’t received any updates from you recently. I will mark this thread resolved for now. If you have any more questions or need further assistance, please feel free to reach out to us anytime!

    Kind Regards,
    Nebu John

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Forminator custom validation’ is closed to new replies.