|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||
|
|||
|
how can i treat a form as an array??
ok guys i have a form that has lots of elements on it
selection boxes,check boxes,input boxes. i have this specific <select name"race" onChange="selectrace()"> </select> and my function is selectrace is a huge function that make lots of other select boxes from disabled to enabled and so on my problem is that i keep adding select boxes, so i want to find a way that dynnamically it will find all selectboxes that there substring(6,8)==something to turn them on and off here is an image to get an idea http://www.mu-saga.com/calculators/ss.gif |
|
#2
|
|||
|
|||
|
RE: how can i treat a form as an array??
function disable_form1() {
for ( var i=0; i<document.form1.elements.length; i++ ) { if(document.form1.elements[i].disabled==true){ document.form1.elements[i].disabled=false }else{ document.form1.elements[i].disabled=true } } } // --> </script> all you need to do is add an IF statement around the existing if statement that evaluates the name to see if it matches the criteria you specified. This will allow you to turn the combo boxes off and on |
|
#3
|
|||
|
|||
|
RE: how can i treat a form as an array??
man you are a LIFE SAVIOUR
just cleaned around 200 lines of uneeded code thx a million |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Client Side Things > how can i treat a form as an array?? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|