• Resolved zMeth

    (@zmeth)


    OK so I am using placeholder text for my input fields and marking them as required, the form can be submitted without any text being entered.

    It is obviously counting the placeholder text as a value which it should not. I have tried using “watermark” instead but this makes no difference.

    I found a solution on stackoverflow:

    Replace ” var submit = form.find(‘input:submit’);
    if (! submit.length) return; “

    with ” var submit = form.find(‘input:submit’);
    if (! submit.length || submit == this.find(‘[placeholder]’).wpcf7Placeholder()) return;”

    This actually works, however throws an error saying “HTMLForm has no method find” which although the validation works fine, it breaks another element on the site.

    Anyone have any ideas please?

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

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

    (@takayukister)

    Try switching to the default theme.

    I had the same issue and I replaced if (! submit.length) return; with if (! submit.length || submit == this.find('[placeholder]').wpcf7Placeholder()) return; but the response button is not working for me. Any idea how to fix this?

    This is fixing the issue but I also found that the responsive button is not displaying the menu options on click.

    Can anyone help me in fixing this issue?

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

The topic ‘Placeholder text validating required fields error!’ is closed to new replies.