• Hi,

    I have two [not required] number fields on the page. When value changed in these number fields, the form validation triggers and display errors every where because I haven’t started filling the required fields YET.
    I found that these are being listened here:

    
    

    e.addEventListener(“change”, (t=>{
    t.target.closest(“.wpcf7-form-control”) && wpcf7.validate(e, {
    target: t.target
    })
    }`

    Is there a way to disable that as it doesn’t make sense to the users? Thanks in advance.

    The page I need help with: [log in to see the link]

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

    (@takayukister)

    What other plugins and theme do you use on the site?

    Thread Starter unicornboat

    (@unicornboat)

    Currently activated plugins are “Classic Editor”, and “Contact Form 7”

    @takayukister that’s literally default behaviour of your plugin. This validation method doesn’t make sense at all.

    Thread Starter unicornboat

    (@unicornboat)

    Can I disabled it? The validation shouldn’t apply to the non-required fields anyway.

    Hey, unicornboat, I’m another CF7 user.

    Not sure if we’re able to remove it since it’s an anonymous function. If it was named, we could just use something like – element.removeEventListener("mousedown", handleMouseDown, false); but since it doesn’t have a name, I don’t know whether or not it can be removed.

    I have the same problem with the “onChange” event on the main form always fires at any change of e.g. a select field. This shows error-hints even before the form is filled out completley or submitted by the user. This is a kind of unexpected behaviour for a form validation in my opinion.

    I understand the idea of “live validation” on every change of the form, but I think this feature only makes sence if the form is submitted first and then validate the missing/wrong fields.

    At least there should be a possibility to deactivate this feature, if possible.

    Many thanks!

    PS: Ok, sorry – now I just noticed that the “live validation” only fires in the case the user misses a required field before (the current changed field). Ok, that makes sense now, but should be deactivateable if needed, please. ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[BUG?] Number field onchange triggers all fields validation’ is closed to new replies.