• Resolved kszum

    (@kszum)


    Hi,

    Is there a way to conditionally disable jQuery validation for single input fields? For example, if checkbox is ticked the date field becomes optional. Thanks.

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

    (@takayukister)

    Contact Form 7 doesn’t use jQuery for validation.

    Thread Starter kszum

    (@kszum)

    Hi,

    Thank for you quick reply.

    Please, let me rephrase. Is there a way to conditionally disable in-browser validation for single input fields? For example, if checkbox is ticked the date field becomes optional. Thanks.

    Plugin Author Takayuki Miyoshi

    (@takayukister)

    Thread Starter kszum

    (@kszum)

    This does not help as there is no way to prevent default rules to be added to the schema, or to remove them.

    Plugin Author Takayuki Miyoshi

    (@takayukister)

    You can prevent default rules from being added to the schema by calling remove_action( 'wpcf7_swv_create_schema', $callback ).

    Thread Starter kszum

    (@kszum)

    It works perfectly, thank you.

    Is there a way to force in-browser validation to remove wpcf7-not-valid-tip? I tried to do it with custom js event attached to a checkbox, but I believe, there maybe a case of race conditions between my script and validation process, which prevents removing the element. Thanks.

Viewing 6 replies - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.