Hi,
Please help. Here is the situation. I've tried to create a radio button
when clickeck by a user, a function will automatically check all
checkbox in a form. I've tried to do this using a for loop but I did
not have any luck.
My intention was when a user click on the radio button, checkbox for
testa,testb,tes tc,and testd will be checked.
<form name="myForm">
check all<input type="radio" name=alert value=all
onclick="checkA ll(this)">
<font color="oliveDra b" size=1%>testa </font><input
type="checkbox" name=aix64testd value=aix64test d>
<font color="oliveDra b" size=1%>presto </font><input
type="checkbox" name=aix64testa value=aix64test a>
<font color="oliveDra b" size=1%>psyn </font><input
type="checkbox" name=aix64testb value=aix64test b>
<font color="oliveDra b" size=1%>psynim </font><input
type="checkbox" name=aix64testc value=aix64test c>
<script type="text/javascript">
function checkAll(Array1 ) {
var myArr = new
Array('aixtestd ','aix64testa', 'aix64testb','a ix64testc');
for(var i; i<myArr.length; i++) {
document.myForm .myArr['+i+']=true;
}
}
<script>
Thx, -Christie
Please help. Here is the situation. I've tried to create a radio button
when clickeck by a user, a function will automatically check all
checkbox in a form. I've tried to do this using a for loop but I did
not have any luck.
My intention was when a user click on the radio button, checkbox for
testa,testb,tes tc,and testd will be checked.
<form name="myForm">
check all<input type="radio" name=alert value=all
onclick="checkA ll(this)">
<font color="oliveDra b" size=1%>testa </font><input
type="checkbox" name=aix64testd value=aix64test d>
<font color="oliveDra b" size=1%>presto </font><input
type="checkbox" name=aix64testa value=aix64test a>
<font color="oliveDra b" size=1%>psyn </font><input
type="checkbox" name=aix64testb value=aix64test b>
<font color="oliveDra b" size=1%>psynim </font><input
type="checkbox" name=aix64testc value=aix64test c>
<script type="text/javascript">
function checkAll(Array1 ) {
var myArr = new
Array('aixtestd ','aix64testa', 'aix64testb','a ix64testc');
for(var i; i<myArr.length; i++) {
document.myForm .myArr['+i+']=true;
}
}
<script>
Thx, -Christie
Comment