I have been working for this for quite a time now. This is regarding the placeholder
issues on IE <10. I saw a lot of this here but i just felt something weird with this case. To solve this issue of mine, i was using placeholder.js.
So my first issues is, i have one <input type="text" id="textbox1" placeholder="My Text"/>
and a dropdown. When I select any from the dropdown, it should change the placeholder which it did. So the options in my dropdown are let's a, b, c
. If i select b/c
at first then click search button (without typing in the textbox), the search will function and the placeholder will not be cleared. But if i select a
, the placeholder text will be gone. It will be displayed again if i click the textbox. And after that selecting b/c
will then have the same behavior.
My second issue with this is when submitting without typing anything in the search box. The placeholder text will be treated as a text and will be then the search word. This is a common issue. I dont know why the polyfill i used was not able to solve this or maybe i should do a lot more than just including the placeholder.js
? So what i just did in my search() function is just this:
if($.browser.msie && $.browser.version < 10.0){
if($("#textbox").val() == $("#textbox" + s).attr("placeholder")){
text = "";
}
}
But this is not actually a good solution. Any ideas? It would really help me. I will gladly appreciate it.