Jump to content

Recommended Posts

Hi all, I need a pair of select boxes to behave like, 1- Just one of them can be checked at any time (like radiobuttoms)2- Both can be unchecked at will (like select boxes). The code bellow is what I have written but it is not working,

<html><head><script>function reCheck(k){if(k<3){document.forms["myform"][k+3].checked = false;		 }	else{document.forms["myform"][k-3].checked = false;}}</script></head><body><form name = "myform" action="dothis.php" method="post"><table  id="MyTable"><?phpfor($i=0;$i<=2;$i++){$j = $i + 3;echo "<tr>";echo "<td>";echo "<input type=\"checkbox\" name=\"".$i."\" onclick = \"reCheck(".$i.")\" />".$i;echo "</td>";echo "<td>";echo "<input type=\"checkbox\" name=\"".$j."\" onclick = \"reCheck(".$j.")\" />".$j;echo "</td>";echo "</tr>";}?></table></form></body></html>

As you can see, in this case there are three rows with a pair of select boxes each, and I need that each pair have the behaviour described above. Looking forward to hear from you, tardebut

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...