|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi, i have a problem. Can someone help me please......
I want to check every checked checkbox in one form. The name is almost same, only last character not, can i use for loop to check it?? The for loop is like below... var checkcount; function checktech() { for (i=1; i<27; i++) { var the_box = document.form1.techbox[i]; if(the_box.checked == true) { checkcount = checkcount+1; } if(checkcount > 3) { alert("Please select no more than 3 option."); } }//end for }//end function <input type="checkbox" name="techbox1" onClick="checktech();" value="eq" > <input type="checkbox" name="techbox2" onClick="checktech();" value="ga"> .... .... until 26 check box |
|
#2
|
|||
|
|||
|
Change
var the_box = document.form1.techbox[i]; by var the_box = eval('document.form1.techbox'+i); and I think that it will work |
![]() |
| Viewing: Dev Shed Forums > Web Design > HTML Programming > Check box ..... |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|