On Jan 25, 7:24 am, mypublicm...@adelphia.net wrote:
Quote:
I'm moving big chunks of html into and out of divs using innerHTML.
Or, I thought I was until I tested it on Firefox 1.5. Firefox will
move the html just fine, but if you have changed any input values in
that html (checkbox, radio, or text values), those new values won't
come along with the html --only their initial values when the html was
made. Internet Explorer 6 does bring the new values along with the
html. If I have to I can parse through the DOM and move all those
values over one-by-one, but I'm hoping there's a simpler solution
available. (I realize Microsoft made innerHTML and that it's still
proprietary --maybe that accounts for the "partial" implementation by
Mozilla.)
|
I think you've answered your own question. Input and similar elements
have DOM attributes for value and default value, however only one can
be represented in HTML. The decision of which value to include seems
to be reflected in the innerHTML property and as you point out, the
lack of a standard means there's no consistency in that regard
(although having a standard may not help anyway :-) ).
I guess you could write your own serialiser for converting such
elements from HTML to say JSON - add your own custom attribute for
default value to preserve the DOM defaultValue attribute and use the
current value as the value attribute.
Even if you do that, when you write it back to the page, how to you
deal with the value and default value thing?
--
Rob