How to Compare Lookup Fields with conditions

By: Sina Pars | Asked: 10/14/2023
ForumsCategory: Code SnippetsHow to Compare Lookup Fields with conditions
Sina Pars asked 7 months ago

Hi there, Suppose I have two lookup fields with the following values: Now, before sending the form, I want to compare some of their values, and if the conditions are met, allow the registration of the form, otherwise, an error.
For example:
If the value of the first field is equal to A and B, the second value should be H and G

and get error > ....custom error 1
Or
If the value of the first field was equal to A, the second value should be C and O

and get error > ....custom error 2
And finally, if a condition was not defined, the form should be registered How can I do this? Is there a sample code? BR

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