peterS.: Javascrip mit Checkbox und Radio Button

Beitrag lesen

gruss Loren;

das waere eine der moeglichen loesungen:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>

<head>
<title>checkOrClear</title>
<script language="JavaScript" type="text/javascript">
<!--
function checkOrClear(falseOrTrue)
 {for (var i=1;i<=5;i++)
  {self.document.forms["yourForm"].elements["yourCheckBox"+i].checked = falseOrTrue;top.focus();}
 }
//-->
</script>
</head>

<body>
<table cols="1" rows="1" width="100%" height="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
 <td align="center" valign="middle">
 <form name="yourForm">

<table cols="1" rows="1" width="50" cellspacing="0" cellpadding="0" border="0">
 <tr>
  <td align="left" valign="top">
  <nobr>
  <input type="checkbox" name="yourCheckBox1" onclick="top.focus()">wunsch 01<br>
  <input type="checkbox" name="yourCheckBox2" onclick="top.focus()">wunsch 02<br>
  <input type="checkbox" name="yourCheckBox3" onclick="top.focus()">wunsch 03<br>
  <input type="checkbox" name="yourCheckBox4" onclick="top.focus()">wunsch 04<br>
  <input type="checkbox" name="yourCheckBox5" onclick="top.focus()">wunsch 05<br>
  <br>
  <input type="radio" name="yourRadio" onclick="top.checkOrClear(true)">check all<br>
  <input type="radio" name="yourRadio" onclick="top.checkOrClear(false)">clear all<br>
  </nobr>
  </td>
 </tr>
 </table>

</form>
 </td>
</tr>
</table>
</body>

</html>

viel spass und by(t)e by(t)e - peterS. - pseliger@gmx.net