When I submit the form, I’d like to validate a text field based on a list of item (8 characters) (kind of whitelist) and depending if the text filed is in the list it redirects the user to a certain page (I’ll have 2 pages) but I’m not sure if it’s possible to do so with the gform_validation and how complicate and safe it could be. I don’t want that during the submission/validation the list of item could be “visible”.
The purpose of the gform_validation filter is to validate the data entered into a field to stop the form submission if the value entered is not according to what you expect. You can find some examples in the filter documentation: gform_field_validation - Gravity Forms Documentation
So this filter is not intended for the redirection use case that you described.
In fact, Gravity Forms doesn’t support doing any redirection before submission. If you’re fine allowing the user to submit the form, then you could use one or several confirmations to redirect the user. One possibility would be to use conditional logic for the confirmations: Conditional Logic in Form Confirmations - Gravity Forms Documentation
Another one, could be using the gform_confirmation with your own PHP code to check the field value and alter the confirmation on the fly: gform_confirmation - Gravity Forms Documentation
Thanks for your answer and the different links, it’s clear and useful.
I’m fine with allowing the user to submit the form and then use the confirmation to redirect them. I’ll have a look in the conditional logic for the confirmations doc.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.