Support » Plugin: Contact Form 7 » Want to make one of two fields required

  • VA1DER

    (@va1der)


    Is there any way to make one of two fields required? I have a form with a telephone number and email address field. I want to require the user to enter in something for one or the other. I do not want to require both. Is this possible?

    I looked at DOM, but there are no events that fire when the user clicks submit but before the form is actually submitted. It seems like a no brainer to have an wpcf7submitclicked event that can then do custom checking and cause the submit to fail if the form fails those checks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Takayuki Miyoshi

    (@takayukister)

    It would be possible by creating a custom validation.

    Thread Starter VA1DER

    (@va1der)

    Thank-you for the reply. Where do the scripts go? I have tried putting them on the extra settings tab but they don’t appear in the form. I have tried putting them on the form tab but then that tab tries to put <p> everywhere.

    Thread Starter VA1DER

    (@va1der)

    Do I have to modify the actual plugin and add the custom validation scripts there?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Want to make one of two fields required’ is closed to new replies.