Wednesday 11 September 2013

Enable or Disable Text field when check the check box in php

//Enable or Disable Text field when check the check box in php

<html>
<head>
<title>bnr</title>
<script language="JavaScript">
<!--

function enable_text(status)
{
status=!status;
document.f1.other_text.disabled = status;
}
//-->
</script>
</head>
<body onload=enable_text(false);>

<form name=f1 method=post>
<input type="checkbox" name=others onClick="enable_text(this.checked)" >Others
<input type=text name=other_text>
</form>

</body>
</html>

1 comment: