Placeholder text validating required fields error!
-
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?
The topic ‘Placeholder text validating required fields error!’ is closed to new replies.