Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jquery.validate & placeholder pluing issue on IE #29

Closed
maximilienborne opened this issue Jun 16, 2011 · 8 comments
Closed

Jquery.validate & placeholder pluing issue on IE #29

maximilienborne opened this issue Jun 16, 2011 · 8 comments

Comments

@maximilienborne
Copy link

Hello,
Just noticed an issue on IE with your plugin and jquery.validate, indeed, when i had a input type password, and i focused on it, it was saying me instantly that the password was good, even if i had a requirement of 6 characters with the validate plugin.
It was because the value of the input was not empty.
I add a short line in your code in your clearPlaceholder function , just after the condition

if ($input.val() === $input.attr('placeholder') && $input.hasClass('placeholder')) {
// this is what i add
-> $input.val("");

Tell me if i was wrong to do that, or if you already noticed this problem.

Beside this, your plugin is great, thank you .

@mathiasbynens
Copy link
Owner

This is fixed in v2.0.0.

@fschroiff
Copy link

Using placeholder 2.0.3 and jQuery 1.7.1 this is not fixed in IE8. Validator plugin (1.9.0) sees the placeholder as input and incorrectly validates the fields as not empty.

@mathiasbynens
Copy link
Owner

@fschroiff Could you please provide a test case?

@fschroiff
Copy link

Try this: http://fernstrg.com/thuis/contact.html
This is the site I am currently working on, I stripped out all the style and images.
Thanks for your quick response!

@fschroiff
Copy link

Made the test case at http://fernstrg.com/thuis/contact.html more concise.

@mathiasbynens
Copy link
Owner

@fschroiff This happens because the jQuery validation plugin uses element.value, and not $element.val(), so the valHooks don’t kick in. I filed jquery-validation/jquery-validation#323 asking to change this for better compatibility with plugins that define custom valHooks.

@ctembreull
Copy link

With the latest of jquery.placeholder and jquery.validate, this still occurs for the specific case of password fields. Other input types are fixed; but the validation seems to be kicking in before the password field's type reverts to "password".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants