I have a simple form with name, phone, email and message.
What I want is for name and then either phone or email or both (standard OR logic) to be required before the form can be submitted.
Does any one know of a way to do this?
Thanks
I have a simple form with name, phone, email and message.
What I want is for name and then either phone or email or both (standard OR logic) to be required before the form can be submitted.
Does any one know of a way to do this?
Thanks
This isn't currently possible. A field is either required or it is not. There is no conditional logic relating to the requirement option. I'm not sure how it could be done with the available API hooks. We will be adding a validation hook in the future, at which time it would be possible to roll your own custom validation. But it would have to be done via PHP and it wouldn't be a feature that has a UI associated with it.
Fair enough, many thanks for getting back to me. in the meantime do you have any recommendations to achieve this?
I don't have any ideas how you would achieve this with our plugin right now. Like I said, it may be possible when we add a hook for form validation but until then i'm not sure how it could be done within the existing available hooks.
i got this to work for me.
i have the same need. i have a form where the user must input either a home, work, or office number. i don't need all three just one or more.
how i got it work:
a required checkbox with conditional logic. the checkbox has home, office, and work as it's values.
three separate phone fields each marked required.
in the advanced tab of all of the phone fields i checked conditional logic and told the fields to show only if the corresponding check was placed on the checkbox above.
its quirky but it actually makes the form look cleaner and not having extra fields taking up real estate.
(i haven't had this form live but it worked great in a test.)
I would like to ask if there is any news on this kind of conditional form validation.
This is a very real world situation. I think it is safe to say many sites need people to either fill out their phonenumber or their emailaddress. (Or both .. but the point here is .. *at least* one of the two.)
Using the method as kindly provided by startac for this, would disallow people to leave *both* phonenumber and emailaddress.
Is there any news about possibly adding such a feature?
There is no news on this feature. We are working on other higher priority features that have broader appeal to our user base. We have to prioritize features based on user need and request volume.
Just thought I'd add a 1+ to this request. Is there somewhere that we can vote on things like this?
For now I am doing something similar to startac, but my client want's it to be a true either/and type situation.
@STB: I got it to allow one, or the other, or both with this setup:
Checkboxes titled: "Which contact methods do you prefer?"
Then Conditional logic on email, home phone and mobile fields that show or hide themselves when the relevant item is ticked. All fields are 'required' including the checkboxes.