Mozilla and DOM

V

Vince Morgan

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
 
V

Vince Morgan

Randy Webb said:
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 :)
IE7 doesn't either. Whether "theform" is the NAME or ID of the form.


What does alert(document.theform.elements.length) alert? 4 or 5?


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
 
V

Vince Morgan

Randy Webb said:
Vince Morgan said the following on 10/29/2006 7:47 PM:

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
 
R

Randy Webb

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.
 
R

Randy Webb

Vince Morgan said the following on 10/29/2006 7:47 PM:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top