Closed ghost closed 9 years ago
I'd been having this issue with IE10/11 lately, and am using this coffeescript as a workaround:
fix_ie10_placeholder = ->
return unless navigator.userAgent.match /Trident\/6\.0|Trident.*rv\:11\./
console.log("fixing ie 10/11 placeholder text turbolinks bug")
$('textarea').each ->
if $(@).val() == $(@).attr('placeholder')
$(@).val ''
Created a pull request for that. https://github.com/mathiasbynens/jquery-placeholder/pull/265 Give it a try, maybe it'd help you.
Thanks -- I'll give it a go and let you know how it works out.
Ah, was wrong. The timeout should be longer. Like 1000 or even 2000
Have you tried using the version on latest commit? https://github.com/mathiasbynens/jquery-placeholder/blob/gh-pages/jquery.placeholder.js it's not minimized, but that's the latest and many bugs were fixed.
Yeah, but this
setTimeout(function() {
$inputs.each(setPlaceholder);
}, 10);
didn't work for me until I increased this to 1-2 sec
@inspire22 that should not be the case. The plugin should not even activate on IE 10/11 since those versions already support placeholder attribute natively.
duplicate of #244
I'm using onclick handlers on an image (I know, this is bad code -- it is legacy code I'm stuck with) that submits the page's form. The placeholder shows up perfectly, but when I submit without changing the placeholder text (in my case "Enter your notes...") shows up in the notes section of the form. I've seen similar issues like this, but no good solutions -- please help!