codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  onCheck of Check Box some buttons will enable  kshitiz at 13:14 on Monday, June 21, 2004
 

In this code i want to enable the add button when checkbox is selected & deselect the same when unselected.

Its functioning one way but not other way .PS suggest some thing
My Code:
<html>
<head>
<script language="javascript">

function enableAdd(){
alert(document.forms[0].C1);
var obj=document.forms[0].C1.value;
if(obj=='ON'){
document.my.b1.disabled=false;
}
else {
document.my.b1.disabled=true;
}
}
</script>
</head>

<body >
<form name="my" >
<INPUT TYPE="submit" name="b1" value="Add" disabled><br>
<INPUT TYPE="submit" name="b2" value="Delete">
<input type="checkbox" name="C1" value="ON" onClick="enableAdd()">
</form>
</body>
</html>