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.)
Thanks for your help,
Dennis 2 2717
On Jan 25, 7:24 am, mypublicm...@ad elphia.net wrote:
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
On Jan 24, 11:18 pm, "RobG" <r...@iinet.net .auwrote:
On Jan 25, 7:24 am, mypublicm...@ad elphia.net wrote:
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?
Thanks -- making a custom attribute (eg, 'newval') for each input
object is how I'll do it. When a user clicks on, say, a checkbox, I'll
call a JS function to set the attribute 'newval' to either 'checked' or
'unchecked'. Right after I innerHTML that code to its new home, I'll
loop through all the input objects and for any that have a
newval=checked or newval=unchecke d, I'll use JS to manually check or
uncheck them. But it would have been cleaner if innerHTML would do
that for me automaticallly (as it does in IE6). This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Kyle |
last post by:
I am presently making use of documentElement.innerHTML to retrieve
page contents for manipulation, but I've noticed that the sting value
returned is not identical to the actual page source. Specifically,
attribute assignments that look like:
height=100 width=100
in the real source, look like:
height="100" width="100"
|
by: kaeli |
last post by:
Hey all,
AFAIR, innerHTML started as MS proprietary, but Mozilla implemented it
as well. Does anyone know if any other browsers support it? It is not in
the W3C DOM, is it? A quick GIS seemed to answer 'no' to that, but you
guys are better at finding these things than I am. ;)
This page seems to think Opera 7, Safari, and IE Mac are cool with it
too, and it seems to be faster. It also implies that innerHTML is NOT in
the W3C DOM. Is...
|
by: TTroy |
last post by:
Hello, I'm relatively new to C and have gone through more than 4 books
on it. None mentioned anything about integral promotion, arithmetic
conversion, value preserving and unsigned preserving. And K&R2
mentions "signed extension" everywhere.
Reading some old clc posts, I've beginning to realize that these books
are over-generalizing the topic. I am just wondering what the
difference between the following pairs of terms are:
1)...
|
by: Luke Matuszewski |
last post by:
Welcome
I have read the in the faq from jibbering about the generic
DynWrite, but i also realized that is uses only innerHTML feature of
HTML objects.
(1) Is there a DOM function which is very similar to innerHTML property
eg. (my guess) setInnerNodeAsText or sth... ?
I want to write function which will be dynamically updateing some of my
select boxes. My question is:
(2.1) Can i use innerHTML property of SELECT (or even incorporate
|
by: SimonV |
last post by:
Hmm, I let the user add more input fields as needed. But I have a
strange problem with ff (and other mozillas)
When I add a field in ff, the others lost their content...
In IE the content stays
Is there a work-around for this?
this a piece of code to check this out:
<html>
<head>
| |
by: Clément |
last post by:
Hi!
I am currently developping a user interface with Ajax/C#/.net. And I am
facing a problem with Mozilla, and Firefox.
I use the function innerHTML to load a Web UserControl into a div, this
way the main page never gets refreshed. It works perfectly under IE,
but with Mozilla and Firefox I got a problem : there is a space before
the thing I want to display everytime I use ".innerHTML".
|
by: Nez |
last post by:
Help needed!
Hello, I have looked everywhere for a solution to my problem and
this is pretty much my last resource. I have created a table in a span
with the innerhtml command in my code behind. In this table I have
created textbox html input fields. Now I need to allow the user to
change the value in the textfield, and compare it to the old value I
have stored in a cookie.
Problem is, because the textfield was created in the code...
|
by: CES |
last post by:
All,
Visual Studio 2005 doesn't include an auto complete item for innerHTML document.getElementById("SomeID").innerHTML, is their a way of referencing the inner text of an element without using ???.innerHTML, that will work in all browsers.
The following works in Firefox (Win & Mac) but not in IE(Win) or Safari.
document.getElementById("SomeID").firstChild.nodeValue = "XXX";
Thanks in advance. - CES
|
by: sophia.agnes |
last post by:
Dear all,
I was going through the book "C a software engineering approach by
darnell & Margolis" there was a section named sign preserving vs value
preserving
it is as follows
sign preserving rule:-
when signed and un signed objects meet in an expression, the result is
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |