0

I am tring to use HTML tags checkbox and textbox along with PHP.
When the checkbox is not checked,the textbox is disable.But when I checked the check box,the textbox should become enabled.

How can i do this?

Here is My code:-

<html>
<head> THIS IS TEST
<title> TEST </title>
</head>
<form>
<body>
 CHECK BOX <input type="checkbox" name="htmlchk" value="chk"id="chk"><br>
 TEXT BOX  <input type="text" id="txt"disabled="True">
<?php
 if($chk.CHECKED=="true")
 {
  $txt.disable="False"
 }
?>
</body>
</form>
</html>

Please help me as soon as possible.

3
Contributors
3
Replies
4
Views
10 Years
Discussion Span
Last Post by R.S.Chourasia
0
<html>

<head>
<script language="javascript">
function checkState()
{
    document.testform.tf1.disabled = !document.testform.tf1.disabled;
}
</script>
</head>

<body>

    <form name="testform">
          <input name="cb1" value="test" type="checkbox" onClick="checkState()"> 
        <input name="tf1" value="test2" type="textfield" disabled="true">
    </form>
</body>
</html>
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.