difference in code

I have a visually designed form (OMG, there we go again)
on that form I have some elements, two buttons, placed exactly over each other.
One is named btn_SomeAction
The other is named btn_SomeAction_grey

btn_SomeAction_grey is a disabled form of the btn_SomeAction. The ENabled button (btn_SomeAction) is on top of the other.
if I type:

forms.myForm.elements.

I see then both buttons by their name

if I try:

oElements = forms.myForm.elements

and next I type:

oElements.

I only see the topmost button.

The question is simple:
Why is that?

FYI, I have two buttons because disabling a button is a real noshow in the browser client.

You should see all the ‘named’ elements on the form.

But can you touch the element by just typing in the name after oElements. ?

Like:

oElements.btn_SomeAction_grey

This should work if you can access this element by forms.myform.elements.

there shouldn’t be any difference when doing:

forms.myform.elements.

or

var somelemenents = forms.myform.elements;
someelements.

that the same object

What the state of of the buttons or where there are located doesn’t have anything to do with that. the only thing that is important is the name.

what do you mean with “noshow in the browser” ?

jcompagner:
“noshow in the browser” ?

DIsabled buttons look ugly in the browser. So that is really a noshow.