mark chopin: Textfeld disabled/abled

Beitrag lesen

[code=html]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<title>switchTextareaAbility</title>
<script language="JavaScript" type="text/javascript">
  <!--
   function switchTextareaAbility () {
     document.forms["one"].elements["two"].disabled = (document.forms["one"].elements["two"].disabled) ? false : true;
   }
  -->
  </script>
</head>

<body>
<form name="one" action="">
  <input type="checkbox" onclick="switchTextareaAbility();">
  <textarea name="two">Text</textarea>
</form>
</body>
</html>
[/code]