473,763 Members | 9,275 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

firefox and innerHTML

Why doesn't a SELECT element's innerHTML reflected which option was
selected? Works in IE. I need this functionality so that I can retain
what choices a user made in a tabbed interface.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
<html xmlns="http://w3.org/1999/xhtml">
<head>

<script language="javas cript">
function callAlert(){
var theHTML = document.getEle mentById('Radiu s').innerHTML;
//alert(theHTML);
}
</script>
<title>Untitl ed Document</title>
</head>

<body>
<form id="myForm">
<div id="myDiv">
<table border="0" width="430" cellpadding="3" cellspacing="0" >
<tr>
<td font color="#ff0000" >*</font>Radius:</td>
<td width="331" height="30" class="formData ">
<select onChange="callA lert();" id="Radius" name="Radius">
<option value=".10" id="0">1/10 mile</option>
<option value=".20">1/5 mile</option>
<option value=".25">1/4 mile</option>
<option value=".5">1/2 mile</option>
<option value=".75">3/4 mile</option>
<option value="1">1 mile</option>
</select>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>

Jul 23 '05
24 3510
Michael Winter schrieb:
On 12/07/2005 13:51, Thomas 'PointedEars' Lahn wrote:
Michael Winter schrieb:
[Multiple forms cannot have the same name attribute value.]
Yes, they certainly can.

<form action="" name="foo"><p></p></form>
<form action="" name="foo"><p></p></form>

is perfectly Valid HTML 4.01 (Strict!).


Based on what criteria? [...]


The HTML 4.01 Specification.
Different `form' elements in one HTML document may of course have
the same value for the `name' attribute or short: the same name.
In the element of the `document.forms ' collection and the value
returned by the HTMLDocument.ge tElementsByName () method, they then
make up an collection of their own.


In the latter, yes. In the former, no. Neither Mozilla (including
recent Firefox releases), Netscape, nor Opera versions prior to 7.11
(possibly earlier, but definitely later than 7.03) return a
collection from the forms collection.


Yes, indeed. And the namedItem() method of the HTMLCollection
interface does not require them to. D'oh.
And when you think about it: not allowing the same name for
different elements would render the getElementsByTa gName() method
of the W3C DOM's HTMLDocument interface redundant.


What's the getElementsByTa gName method got to do with this?


Nothing, repeated typo.
As for getElementsByNa me, the answer there is actually quite simple:
the HTMLCollection interface is only meant to return single
Node-implementing objects via the item and namedItem methods (and the
property accessor equivalents). That browsers return a collection is
a product of DOM 0, not DOM 1 or 2. As such, the getElementsByNa me
method was meant to fill this void.

Of course, I'm not, nor have I been, a member of the HTML or DOM
Working Groups, so this is just my interpretation of events.


You're probably right.
PointedEars
Jul 23 '05 #21
On 13/07/2005 08:36, Thomas 'PointedEars' Lahn wrote:

[Referring to getElementsByTa gName, not getElementsByNa me]
Oh my, yes of course! :) Sorry for causing confusion.
Given the poor state of mind I was in yesterday (I've had sleep now.
Yay! :D), you certainly did confuse me. You're forgiven, though. :p

[Retaining the name attribute in XHTML]
No, in XHTML 1.0 _Strict_, the following elements do have the `name'
attribute:

meta, a, object, param, map, input, select, textarea, button.

Only four of them can be considered form elements.


Five, I believe. The OBJECT element can also participate in form
submissions, however the specification doesn't define how this
particular mechanism works which is verging on ridiculous. Still, it is
a form control and retains its name attribute for this purpose.

[snip]

Mike

--
Michael Winter
Prefix subject with [News] before replying by e-mail.
Jul 23 '05 #22
Michael Winter schrieb:
On 13/07/2005 08:36, Thomas 'PointedEars' Lahn wrote:
[Retaining the name attribute in XHTML]

No, in XHTML 1.0 _Strict_, the following elements do have the
`name' attribute:

meta, a, object, param, map, input, select, textarea, button.

Only four of them can be considered form elements.
Five, I believe. The OBJECT element can also participate in form
submissions,


Yes, indeed!
however the specification doesn't define how this particular
mechanism works [...]


<http://www.w3.org/TR/html4/struct/objects.html#ed ef-OBJECT>
PointedEars
Jul 23 '05 #23
On 13/07/2005 11:11, Thomas 'PointedEars' Lahn wrote:
Michael Winter schrieb:


[Submitting an OBJECT]
however the specification doesn't define how this particular
mechanism works [...]


<http://www.w3.org/TR/html4/struct/objects.html#ed ef-OBJECT>


I meant regarding the value of that OBJECT element. In both 17.2 and
17.12.2, the specification says that the value "is determined by the
object's implementation" .

The description in 17.2 goes on to say:

"... (i.e., it lies outside the scope of this specification). "

Mike

--
Michael Winter
Prefix subject with [News] before replying by e-mail.
Jul 23 '05 #24
Michael Winter schrieb:
On 13/07/2005 11:11, Thomas 'PointedEars' Lahn wrote:
Michael Winter schrieb:


[Submitting an OBJECT]
however the specification doesn't define how this particular
mechanism works [...]


<http://www.w3.org/TR/html4/struct/objects.html#ed ef-OBJECT>


I meant regarding the value of that OBJECT element. In both 17.2 and
17.12.2, the specification says that the value "is determined by the
object's implementation" .

The description in 17.2 goes on to say:

"... (i.e., it lies outside the scope of this specification). "


ISTM that having the `object' element as a descendent of the `form'
element and submitting the form it creates would submit the data of
the resource that the `object' element refers to which is referred
to as the `object' element's value. That would allow for submitting
any form of information if the UA provided means to display it. Of
course the way how the UA displays it (e.g. what plugin is used and
what parameters it needs) would lie outside the scope of the HTML
4.01 Specification.
PointedEars
Jul 23 '05 #25

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
2530
by: catorcio | last post by:
I'm trying to have some text in my page changed by clicking a button. Googleing around I've discovered that innerText doesn't work with every browser, so I've switched to innerHTML. It works fine on IE and Opera, but nothing happens on Firefox (just updated to version 1.0.4). Any suggestions? Thanks in advance! C.
9
2124
by: Astra | last post by:
Hi everybody Wonder if you could help me out. I created a simple JavaScript routine to enable a user to click backwards and forwards between small news articles. This routine works fine in IE and Safari, but in the latest FireFox I get no title or article, but do see the prev and next links and the article number. My HTML and JS simple routine is as follows:
5
3001
by: Craig Keightley | last post by:
Please help, i have attached my page which worksin IE but i cannnot get the drop down menu to fucntion in firefox. Any one have any ideas why? Many Thanks Craig <<<<<<<<<<<<<<CODE>>>>>>>>>>>>>>>> <html>
4
8026
by: Jake Barnes | last post by:
I wanted to teach myself AJAX this weekend so I sat down with Stuart Landgridge's book and I started to play around. I came up with a little page that you can add text and images to. You can see it here: http://www.publicdomainsoftware.org/ajaxExperiment.htm Click in any box to get the controls with which you can play around. This function below, askForInput, was working the way I wanted, till I tried to give it two parameters, one...
10
12684
by: Jake Barnes | last post by:
This weekend I wanted to learn AJAX, so I set up a little toy page where I could experiment. The idea of this page is that you click in one of the boxes to get some controls, at which point you can add text, images, or HTML to the box. This seems to work fine in FireFox, but not in IE. You can see the problem here: http://www.publicdomainsoftware.org/ajaxExperiment.htm In FireFox, if you click in a box and then select "Add HTML" you...
2
9565
by: sveinn | last post by:
Hi all, I've read through this group searching for an answear about this problem. Few have come close but not quite what I need. My problem is this: I'm using Ajax to fetch a new table with input boxes. I then take the innerHTML from my <div> and add the new table to the existing one/s. What happens in FireFox is that all values in other tables input boxes
7
27134
by: Hoss | last post by:
Hello all- This is what im trying to achieve. At the top of my page there is some search functionality, through which you cause to be loaded a string representing an HTML page. Below this and occuupying about 80% of the window real estate, there is a DIV. There is also a toggle button with two options "Code View" and "Text View" as I have named them. Depending on which mode you are in, you can see the block of HTML either as code (in...
4
11305
by: uwe.braunholz | last post by:
Hello, I want to set the text of a marqee dynamical. So I created the following code: ****snip**** <style> #noticeMarquee { background-color:#ff00ff; color:#ffffff;
4
5132
by: tcole6 | last post by:
My problem appears to be Firefox specific. I have a hyperlink that loads a new window. This window contains hyperlinks that call javascript functions in the parent window and then closes the child window. The function that is called contains an XMLHttpRequest. My problem is that everything happens as it should, the innerHTML is changed by the results of the XMLHttpRequest and the child window closes. The problem is this, in Firefox,...
1
15787
by: raju78.k | last post by:
Hi, I have a problem with FireFox. I have written a function to Add rows without submiting the form. This function works fine in IE, but not in FireFox. The function is : function createRows(deviceId,deviceType,modelName,ipAddress,macAddress,imageURL)
0
10148
Oralloy
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...
1
9938
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9823
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8822
agi2029
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...
1
7368
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5270
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...
0
5406
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3917
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
2
3528
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.