Open john-cheesman opened 10 years ago
This. Very much this. Came here to check this issue.
I've had this happen on IE11 on Win7
@john-cheesman I've fixed it by making sure that IE11 doesn't run on IE8 compatibility mode. It works for IE8 and not for 11 in comp. mode.
+1 Having the same issue in Win7 IE9. The placeholder text is occasionally inserted as value when form is submitted.
Is there any fix for this ?
This project seems kinda dead.
I will get around to investigating this. There is already code in there to remove placeholders before form submission but clearly there's a bug with it somewhere. I'm more than happy to accept pull requests should anyone like to take a look.
@RobQuistNL The project isn't dead, just slow-moving. Mainly because I'm busy with other things but also because this project should be becoming less and less necessary. Browser support for the placeholder
attribute is strong and it's only really IE9 and below that this is now helpful for. Since I don't have to support IE9 or below in any of my projects this ends up taking a back seat. As mentioned previously, I'm always happy to accept pull requests.
Ah right, sorry @jamesallardice - i had that idea because of the old commits and responses. You're right that this is less and less useful.
@vikuseth for the time being you could try to fix it server-side?
Not sure if this is the appropriate issue to post in, but when using the Zebra datepicker plugin in IE 8 or IE 9, the placeholder text is submitted as the value. Not sure if the bug is in Zebra or in this plugin, but the Zebra plugin without the placeholders plugin doesn't show placeholders on IE 8 and IE 9 at all so I am guessing the surprise input is coming from here.
I found the problem within the function newElement( elem )
.
In this function there is a check:
var form = elem.form;
if ( form && typeof form === 'string' ) {
The property elem.form
is the actual form for me. So I modified the check:
var form = elem.form;
if (form) {
Then I removed the line:
// Get the real form.
form = document.getElementById(form);
because form now already contains the actual form. After this, the placeholders get removed on submit correctly and are not POST-ed by the form.
@jamesallardice Can you confirm the fix provided by @littletijn is safe to use? I've tried what is suggested and it does seem to resolve the issue.
I've also just tried the above fix, and it does indeed seem resolve the issue.
Looks like there are no ill-effects when using this fix (and reading the code, it looks to have been an innocent oversight). @littletijn do you want to submit a PR for this? If no, I am happy to put one together myself, crediting where necessary.
Whoops. I forgot I had this fix on GitHub. I just found the e-mail for the replies on this issue. Thanks for making the commit on behalf of me.
@jamesallardice Can you, please, put up a 4.0.2 build with this fix? It's really needed for IE9.
Many thanks @littletijn & @rmorrin for the fix! :+1:
If a form is submitted with fields that have not been completed, the placeholder text is submitted as their value. Is it possible to remove the placeholders on submit to prevent them from being submitted?