PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Alternative Required Fields

  1. Blue Chives
    Member

    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

    Posted 14 years ago on Saturday April 10, 2010 | Permalink
  2. 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.

    Posted 14 years ago on Sunday April 11, 2010 | Permalink
  3. Blue Chives
    Member

    Fair enough, many thanks for getting back to me. in the meantime do you have any recommendations to achieve this?

    Posted 14 years ago on Sunday April 11, 2010 | Permalink
  4. 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.

    Posted 14 years ago on Monday April 12, 2010 | Permalink
  5. startac
    Member

    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.)

    Posted 14 years ago on Tuesday July 6, 2010 | Permalink
  6. STB
    Member

    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?

    Posted 14 years ago on Saturday October 23, 2010 | Permalink
  7. 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.

    Posted 14 years ago on Monday October 25, 2010 | Permalink
  8. 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.

    Posted 13 years ago on Saturday February 19, 2011 | Permalink