I have something in my web form:
input type = "hidden "Name" = "myField" value = "default value" />
Later, in some JavaScript, I am overwriting the default value before submitting a page on the server
var formField = document.getElementsByName ("myField") [0]; FormField.setAttribute ("value", "myNewValue"); Var form = document.getElementById ("myForm"); Form.submit ();
All browsers (IE 5-IE 8, Firefox, Opera, Crow , Safari, has tested this code for many years) sending "myNewValue" to the server. Excluding IE9: This "Default Value" sends what's going on here? Am I forgetting something?
If I remove the "value" attribute from the field, then it also works in IE9.It works in IE9, if I switch to IE8 rendering mode.
< P> Is this a bug or IE9 considers to be more standard than other browsers?
Davidordord appears to be correct in relation to HTML4, but in the practice of breaking backward compatibility It seems, so I would like to tell HTML5 what the browsers really are doing. And it sounds like it says: (my emphasis)
The value content attribute gives the default value of the input element when the value content attribute is added, is set or removed , Then the dirty value flag of control is false, then the user agent has to set the value of element for the value of the value content attribute, if there is one, or the empty string otherwise, and then the present value synchronization algorithm To run the image, if any is defined.
Your scenario does not describe anything, set will set the dirty value flag before the attribute call, so I believe that setAttribute is called Value Property And the browser should not send myNewValue to default.
So yes, I think this is an IE9 beta bug.
Comments
Post a Comment