fnd the type of control in a form

D

dev.amit

hello friends
i have a form which has five dropdown, two check box and a textbox. i
want to find the controls inside the form and disable them. No id or
name attribute is to be used as it is to be a generic one. so it can
be used in the other places.
Any help would be great
Thanks
Amit
 
B

Bart Van der Donck

dev.amit said:
hello friends
i have a form which has five dropdown, two check box and a textbox. i
want to find the controls inside the form and disable them. No id or
name attribute is to be used as it is to be a generic one. so it can
be used in the other places.

So I suppose you want to disable all your form elements

for (x=0;x<document.forms[0].length;x++) {
document.forms[0].elements[x].disabled=true
}

(I'm referring to the form as forms[0] because I suppose you only have
one <form> on your web page)

Hope this helps,
 

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
474,436
Messages
2,571,696
Members
48,796
Latest member
Greg L.
Top