<script>
function clicked(cID){
if(cID=="c1"){
document.getElementById('c2').checked=false;
document.getElementById('c3').checked=false;
}
if(cID=="c2"){
document.getElementById('c1').checked=false;
document.getElementById('c3').checked=false;
}
if(cID=="c3"){
document.getElementById('c1').checked=false;
document.getElementById('c2').checked=false;
}
}
</script>
<input type="checkbox" id="c1" onClick="clicked(this.id);">
<input type="checkbox" id="c2" onClick="clicked(this.id);">
<input type="checkbox" id="c3" onClick="clicked(this.id);">
نوشته ت رو منتقل کن به انجمن جاواسکریپت ، یا اگه نمیتونی ، یکی از مدیران این کار رو انجام بده.سوالتو توی انجمن جاوا اسکریپت مطرح کن.
اونجا بهتر جواب می گیری
<html>
<head>
<script type="text/javascript">
function uncheckother(cur){
var total=19;
for(i=0;i<total;i++){
if ('myCheck'+i !==cur){
document.getElementById('myCheck'+i).checked=false;
}
}
}
</script>
</head>
<body>
<form>
<input type="checkbox" id="myCheck0" onclick="uncheckother(this.id)" />
<input type="checkbox" id="myCheck1" onclick="uncheckother(this.id)"/>
<input type="checkbox" id="myCheck2" onclick="uncheckother(this.id)"/>
<input type="checkbox" id="myCheck3" onclick="uncheckother(this.id)" />
<input type="checkbox" id="myCheck4" onclick="uncheckother(this.id)"/>
<input type="checkbox" id="myCheck5" onclick="uncheckother(this.id)"/>
<input type="checkbox" id="myCheck6" onclick="uncheckother(this.id)" />
<input type="checkbox" id="myCheck7" onclick="uncheckother(this.id)"/>
<input type="checkbox" id="myCheck8" onclick="uncheckother(this.id)"/>
<input type="checkbox" id="myCheck9" onclick="uncheckother(this.id)" />
<input type="checkbox" id="myCheck10" onclick="uncheckother(this.id)" />
<input type="checkbox" id="myCheck11" onclick="uncheckother(this.id)"/>
<input type="checkbox" id="myCheck12" onclick="uncheckother(this.id)"/>
<input type="checkbox" id="myCheck13" onclick="uncheckother(this.id)" />
<input type="checkbox" id="myCheck14" onclick="uncheckother(this.id)"/>
<input type="checkbox" id="myCheck15" onclick="uncheckother(this.id)"/>
<input type="checkbox" id="myCheck16" onclick="uncheckother(this.id)" />
<input type="checkbox" id="myCheck17" onclick="uncheckother(this.id)"/>
<input type="checkbox" id="myCheck18" onclick="uncheckother(this.id)"/>
</form>
</body>
</html>
<html>
<head>
<script type="text/javascript">
function uncheckother(cur,seri){
c1=document.getElementById(seri+'1');
c2=document.getElementById(seri+'2');
c3=document.getElementById(seri+'3');
if (cur==1){
c1.checked=true;
c2.checked=false;
c3.checked=false;
}else if(cur==2){
c1.checked=false;
c2.checked=true;
c3.checked=false;
}else{
c1.checked=false;
c2.checked=false;
c3.checked=true;
}
}
</script>
</head>
<body>
<form>
<div>
<input type="checkbox" id="a1" onclick="uncheckother(1,'a')"/>
<input type="checkbox" id="a2" onclick="uncheckother(2,'a')"/>
<input type="checkbox" id="a3" onclick="uncheckother(3,'a')" />
</div>
<div>
<input type="checkbox" id="b1" onclick="uncheckother(1,'b')"/>
<input type="checkbox" id="b2" onclick="uncheckother(2,'b')"/>
<input type="checkbox" id="b3" onclick="uncheckother(3,'b')" />
</div>
<div>
<input type="checkbox" id="c1" onclick="uncheckother(1,'c')"/>
<input type="checkbox" id="c2" onclick="uncheckother(2,'c')"/>
<input type="checkbox" id="c3" onclick="uncheckother(3,'c')" />
</div>
<div>
<input type="checkbox" id="d1" onclick="uncheckother(1,'d')"/>
<input type="checkbox" id="d2" onclick="uncheckother(2,'d')"/>
<input type="checkbox" id="d3" onclick="uncheckother(3,'d')" />
</div>
<input type="checkbox" id="e1" onclick="uncheckother(1,'e')"/>
<input type="checkbox" id="e2" onclick="uncheckother(2,'e')"/>
<input type="checkbox" id="e3" onclick="uncheckother(3,'e')" />
</form>
</body>
</html>