470,614 Members | 1,491 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,614 developers. It's quick & easy.

Mozilla and DOM

Hi All,
I have an 'input' that is of type= "image", and name="butt",
that I need to enable/disable from time to time.
In IE (6) I used [document.theform..butt.disabled=condition] and it worked
fine. However, in a Mozilla (latest vers, no number avail) it doesn't see
this as an object. As a workaround I declared a global var 'theButton' and
used 'onLoad="theButton=this;"' within that 'input' to set the value, and
this works fine in both Moz & IE.
Having to use a global var is not a problem, but I would like to know why
the original attempt didn't work in both browsers? The 'form' that 'butt'
is a member of contains 1 select, 3 type="text" inputs, and finaly the
type="image" input.
Perhaps Moz doesn't add an 'input' of type="image" to the collection if the
types are mixed?
Any light on this would be very welcome.
TIA,
Vince Morgan
Oct 29 '06 #1
4 1121
Vince Morgan said the following on 10/29/2006 12:30 AM:
Hi All,
I have an 'input' that is of type= "image", and name="butt",
that I need to enable/disable from time to time.
In IE (6) I used [document.theform..butt.disabled=condition] and it worked
fine.
I hope that was a typo, theform..butt with two dots.
However, in a Mozilla (latest vers, no number avail) it doesn't see
this as an object.
IE7 doesn't either. Whether "theform" is the NAME or ID of the form.
Having to use a global var is not a problem, but I would like to know why
the original attempt didn't work in both browsers? The 'form' that 'butt'
is a member of contains 1 select, 3 type="text" inputs, and finaly the
type="image" input.
What does alert(document.theform.elements.length) alert? 4 or 5?
Perhaps Moz doesn't add an 'input' of type="image" to the collection if the
types are mixed?
It is because it is type image, not because types of elements are mixed
in the form.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Oct 29 '06 #2
"Randy Webb" <Hi************@aol.comwrote in message
news:w5********************@telcove.net...
Vince Morgan said the following on 10/29/2006 12:30 AM:
Hi All,
I have an 'input' that is of type= "image", and name="butt",
that I need to enable/disable from time to time.
In IE (6) I used [document.theform..butt.disabled=condition] and it
worked
fine.

I hope that was a typo, theform..butt with two dots.
It was :)
However, in a Mozilla (latest vers, no number avail) it doesn't see
this as an object.

IE7 doesn't either. Whether "theform" is the NAME or ID of the form.
Having to use a global var is not a problem, but I would like to know
why
the original attempt didn't work in both browsers? The 'form' that
'butt'
is a member of contains 1 select, 3 type="text" inputs, and finaly the
type="image" input.

What does alert(document.theform.elements.length) alert? 4 or 5?
Perhaps Moz doesn't add an 'input' of type="image" to the collection if
the
types are mixed?

It is because it is type image, not because types of elements are mixed
in the form.
So image type elements cannot be referenced as above? I would be very
gratefull to know the correct method.
Thank you very muchly for the responce Randy.

Vince Morgan
Oct 30 '06 #3
Vince Morgan said the following on 10/29/2006 7:47 PM:
"Randy Webb" <Hi************@aol.comwrote in message
news:w5********************@telcove.net...
>Vince Morgan said the following on 10/29/2006 12:30 AM:
<snip>
>>Perhaps Moz doesn't add an 'input' of type="image" to the collection if
the
>>types are mixed?
It is because it is type image, not because types of elements are mixed
in the form.
So image type elements cannot be referenced as above? I would be very
gratefull to know the correct method.
Thank you very muchly for the responce Randy.
Give it an ID and use gEBI to get a handle on it.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Oct 30 '06 #4

"Randy Webb" <Hi************@aol.comwrote in message
news:n4********************@telcove.net...
Vince Morgan said the following on 10/29/2006 7:47 PM:
"Randy Webb" <Hi************@aol.comwrote in message
news:w5********************@telcove.net...
Vince Morgan said the following on 10/29/2006 12:30 AM:

<snip>
>Perhaps Moz doesn't add an 'input' of type="image" to the collection
if
the
>types are mixed?
It is because it is type image, not because types of elements are mixed
in the form.
So image type elements cannot be referenced as above? I would be very
gratefull to know the correct method.
Thank you very muchly for the responce Randy.

Give it an ID and use gEBI to get a handle on it.
I'm very much a JS noobie and haven't paid the amount of attention to gEBI
that I should have been I see.
Thanks again for your help.
Regards,
Vince Morgan
Oct 30 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Jakub Fast | last post: by
2 posts views Thread by Peter | last post: by
10 posts views Thread by tony kulik | last post: by
10 posts views Thread by News | last post: by
20 posts views Thread by Thorsten Kampe | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.