Validate value of a field without using frm_validate_field_entry hook

By: Tom Boltwood | Asked: 12/07/2022
ForumsCategory: General questionsValidate value of a field without using frm_validate_field_entry hook
Tom BoltwoodTom Boltwood asked 1 year ago
I've been using hooks for so long, I've forgotten how to use the builder properly. I have a form with radio buttons. I don't want people to be able to go further if they choose 'No'. I'm sure in the past I was able to put a tick next to the correct answer or something. I can't find any way to validate the answer, what am I missing? It seems overkill to have to write a function to take care of this.
Victor Font replied 1 year ago

Just to be clear, do I understand that you want to validate a Yes/No field for a correct answer?

Bobby Clapp replied 1 year ago

Also, is it a single page form?

Tom BoltwoodTom Boltwood replied 1 year ago

<p>Yes, that's correct. I'm sure there used to be an option to put a tick against any acceptable answers. And yes, single page. At the moment, I'm thinking that I might want it to be multi-page due to its size.</p>

1 Answers
Bobby Clapp answered 1 year ago

I'm guessing conditional logic is what you are looking for. You can use submit button logic - https://formidableforms.com/knowledgebase/general-form-settings/#kb-submit-button-logic or logic within the fields to check answers of previous questions and then hide or show fields based on that.

Tom BoltwoodTom Boltwood replied 1 year ago

<p>Ah, that looks interesting, that sure wasn't there in earlier versions of formidable. I've not used it for a complicated form in a few years. There used to be a validation section in every field.</p>

Bobby Clapp replied 1 year ago

Conditional logic exists for nearly every field as well as the submit button.

Tom BoltwoodTom Boltwood replied 1 year ago

Yes, but it only hides or shows a field, it doesn't validate it. I don't understand what happened to the validation, I'm sure you used to be able to tick a box for an acceptable answer, enter answers that would be acceptable, and even enter regex for acceptable formatting.

Bobby Clapp replied 1 year ago

Only thing I know of other than built in formatting for input fields is the hook Victor alluded to -> https://formidableforms.com/knowledgebase/frm_validate_field_entry/

Tom BoltwoodTom Boltwood replied 1 year ago

That was me actually. Looks like I'll be using a function to perform a simple validation! Why did they remove the validation feature I wonder?

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right