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
Placeholder Support for IE9 #2401
Comments
I'm sure you could find other ways to get around this for now ;) But yes, perhaps a built-in/optional module for it would be nice. Perhaps you could do it yourself? |
Take a look at this plugin. It works well for me. |
I second @R1ch0 's comment. I am using @mathiasbynens placeholder plugin for a while now and it's working great! |
Thanks all, I like @mathiasbynens placeholder solution better than others I have seen as it does a browser check first before attempting any work related to adding the placeholder. Looks like a solid solution which I plan to implement later this week. Thanks all for the very helpful responses. |
OK I found a bummer issue when using @mathiasbynens placeholder solution, when using input(s) with validation and placeholder text the validation believes a required input has been populated when it contains placeholder text. This is a deal breaker...how did you guys work around this one? |
In browsers that don't support That's just some basic and quick workaround... :) |
Thanks but that is not going to always work, I have other validation such as numeric only, regular expression, etc which are not going to work. It appears https://twitter.com/signup has worked around this somehow for IE browsers -- at this point I am starting to think I need to move to a vertical form layout and do away with placeholder text... |
Well i have used this plugin for validation: http://bassistance.de/jquery-plugins/jquery-plugin-validation/ That
https://github.com/jzaefferer/jquery-validation/blob/master/jquery.validate.js#L960 Or write new custom validator that behaves same as the default That way you can have whatever validation you want, i mean how many you want, the thing to understand is that all your rules for given field need to be valid in order for given field to be valid, .i.e. if you have 4 out of 5 rules valid, and only Hope i am making some sense here... =D |
Hey Gavrisimo thanks a ton for your assistance. My project is based on MVC 4 which uses jquery,validate.js and jquery.validate.unobtrusive.js which ships with MVC. It appears your solution would require a rip and replace which may be totally worth the work, my only concern and hesitation at this point is my Jquery skillz :-) I am concerned with the level of effort this would take. The unobtrusive validation is nice because it uses HTML5 data annotations, for example: <input data-val-regex="The Last Name can only contain letters." data-val-regex-pattern="[a-zA-Z]*" ... /> This is very clean and works as needed minus the placeholder text issue. I wonder if I could hook a pre-validation event, where if(IE){ for each input with placeholder and val() == placeholder text, remove val(), allow validation to occur, and on post validation replace the placeholder text on each element I just previously modified. Again my concern is around how green I am when it comes to jquery/javascript. |
Well it can be pretty simple to create some "custom" Just check for that custom class, return false always if it's present, else check if it's empty or not and return accordingly. That way you only need to change source of placeholder plugin to add that custom class here: https://github.com/mathiasbynens/jquery-placeholder/blob/master/jquery.placeholder.js#L147 and here: https://github.com/mathiasbynens/jquery-placeholder/blob/master/jquery.placeholder.js#L150 Maybe it needs to be added somewhere else, but you get the point. |
OK I believe I found a solution, not sure if I will have any side effects from this but I modified the code you provided, specifically I changed the method name to required which I believe overwrites the original handler. $.validator.addMethod("required", function (value, element) { |
@Gavrisimo You could just use the See jquery-validation/jquery-validation#323 for some other possible solutions. |
@mathiasbynens Yeah, but that was a bit too generic for me. :) Thanks for the link! |
We won't be adding this I think, unless @fat wants to get in there and play with IE :). We'll defer to third party plugins for now. |
is this still the case? no support for placeholder workaround? just curious which is the best workaround so far? |
Actually I would like to see this problem fixed and buil-in Bootstrap, its a main feature bacause there is a form type called "Inline" so it suppose to be a "Inline form" working in all compatible browsers (like IE). Otherwise, somebody could tell us the best implementation possible with a little guide? thanks guys |
+1. Fix this. |
There's nothing to fix. There's no bug in BS. It's a browser compatibility issue and there are plenty of third party plugins available to add compatibility if desired. |
This has been my first compatibility stumbling block with bootstrap, which is a huge testament to the developers. That said, support would be hugely appreciated. At the very least, I think there should be a "heads up!" marker discussing the incompatibility where forms are described. |
@markdotto & @fat - I'd be happy to add the functionality for this if you'd reconsider adding it to BS. |
just load shiv, placeholder works fine with ie9 |
+1 compatibility :) |
@mathiasbynens placeholder.js is working great for me in IE9, but not working in IE8. Any suggestions? |
Same, placeholder.js in IE8 does not behave the same. I had to implement a On Sun, Jan 6, 2013 at 8:10 PM, greendezine notifications@github.comwrote:
|
Are you talking about |
placeholder.js will bring you problems instead of good placeholders. And if you want to check if(!input.value) in any place of your JS I've got this problems and spend time for understanding why my scripts are not On Sun, Jan 06, 2013 at 05:09:20PM -0800, greendezine wrote:
|
@RusAlex Correct me if I'm wrong, but in the function call, you can scope the jquery down to specific form selectors on the page. @mathiasbynens. Yep, jquery.placeholder.js. Bug has been filed. |
Hi, I got a problem with place holder, when i am opening into internet explore and samsung default browers when i focus on text field placeholder is disable. Not wait up to user enters the one character . But the other browers working fine up to wait the user enters the one character. Sample html :: "" If any one face this problem please send me the solution ..... Thanks, |
For some reason placeholder text does not work on IE9 much less earlier browsers. Not supporting the latest version of the most popular browser really hurts my ability (and I am sure others) to adopt this framework for any serious application. The reason for placeholder text is to save screen space and/or offer formatting help, etc. I personally really need a solution which is cross browser and I really love this framework minus the support for the latest version of IE.
The text was updated successfully, but these errors were encountered: