• Resolved LESIMOON

    (@lesimoon)


    Hi there.

    I managed to get some conditionnal fields on my contact form.
    A simple radio input displaying 2 differents text input.
    I want to make the displayed input required and remove the other one if needed.

    At the moment, I’m using a jQuery script. It adds the class “wpcf7-validates-as-required” and the attribute “aria-required=true” to the displayed elements (and remove then to the non displayed input.

    Even if this script is working (according to firebug), the form doesn’t take care of those class/attribute.

    Did I forget something?
    Cheers

    https://wordpress.org/plugins/contact-form-7/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter LESIMOON

    (@lesimoon)

    I would love any answer 🙁

    Plugin Author Takayuki Miyoshi

    (@takayukister)

    Contact Form 7 doesn’t use HTML5 browser-side validation. All the validation is done server-side (after submission).

    It adds the class “wpcf7-validates-as-required” and the attribute “aria-required=true” to the displayed elements (and remove then to the non displayed input.

    Those don’t affect the validation. They are just for giving information.

    Thread Starter LESIMOON

    (@lesimoon)

    Alright thank you.
    I managed to “bypass” this validation with a script (see here). I think adding the add_filter() hook can also do the job.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘What is the html required property ?’ is closed to new replies.