• Resolved pmi-it

    (@pmi87it)


    Good morning ??

    After updating Contact Form 7, we saw that when a user now clicks a checkbox field (no matter if its only one option or more available), the field validation for the whole contact form gets triggered directly. In our case, a user wants to tick a checkbox for “topics of interest” before he enters his mailaddress. Now, every required field gets the notification “Please fill out this field.”

    In my opinion, this doesnt make much sense. It breaks many of our contact forms, where we use checkboxes and from a UX perspective, we dont want to move all required fields to top of our contact forms, to workaround this issue.

    To validate I created a fresh WordPress Installation and installed only Contact Form 7 Version 5.6 on it.

    Could you please help? Was this change intended, or is it a bug?

    Thank you very much in advance, Regards,

    Patrick

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

    (@takayukister)

    Where can we see the website in question?

    Thread Starter pmi-it

    (@pmi87it)

    Like described, I spinned up a local environment to verify that it even happens with a fresh install of wordpress with only Contact Form 7 on it. I used the standard form which gets created after a fresh plugin install and just added the following field to field configuration:

    [checkbox checkbox-689 use_label_element “test1”]

    So there cannot be any side effects with other plugins or the used theme.

    Thread Starter pmi-it

    (@pmi87it)

    This live link will be available only today, since its hosted locally:

    Open Live Link:
    https://possible-letter.localsite.io

    If prompted, enter the information below.

    Username: suggestion
    Password: snarky

    Thread Starter pmi-it

    (@pmi87it)

    An update from my side. The idea with the local server wasnt so great. Therefore I created a fresh hosted server. Its running 24/7 and will be deleted, when we were able to sort this out ??

    https://cf7temp.de-fra1.cloudjiffy.net/

    Plugin Author Takayuki Miyoshi

    (@takayukister)

    I checked the cf7temp.de-fra1.cloudjiffy.net site. Seemingly there is no problem with the form. The checkbox is working as expected.

    Thread Starter pmi-it

    (@pmi87it)

    Good morning ??

    When I understand it right, every validated field (I just realized that the E-Mail Field does the same) triggers validation for all fields above. I changed the example on the website a litte bit, to get a better understanding.

    When I now click checkboxes in the first fields block, none of the fields below show the error notice. When I click checkboxes of the last fields block, every field above gets validated directly.

    So this is a new behaviour since v5.6; before this versions, the validation started when a contact form was going to be submitted.

    After understanding the behavior better, I must admit, that it has some advantages. Users filling out a contact form will be forced to fill everything out from top to bottom, instead of jumping around in the fields.

    Its just that we need to change some contact forms, because we autofill checkboxed via Javascript, which are at the bottom of the form.

    Plugin Author Takayuki Miyoshi

    (@takayukister)

    This is a tip not documented yet, form fields under an element that has the novalidate class are excluded from the client-side validation targets.

    <p class="novalidate">
      [checkbox* your-country "China" "India" "San Marino"]
    </p>

    In this example, the checkboxes will be validated only when you submit the form.

    Thread Starter pmi-it

    (@pmi87it)

    Takayuki, this also works with <div>s ?? thank you very much. This is exactly what we need ?? Thank you for all your replies and have a very good day ?? Thank you for all the work with contact form 7.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘frontend click on a [checkbox …] field triggers validation’ is closed to new replies.