Switch to full style
JavaScript code examples
Post a reply

disable button

Thu Sep 15, 2011 8:56 pm

enable button and disable it based on check button .
Code:

<html>
<
title>Disable button</title>
<
head>
<
script language="Javascript" type="text/javascript">
 function allowSubmit(){
  if (document.checkdiv.termscheck.checked==''){
   document.checkdiv.register.disabled=true
  
}else{
   document.checkdiv.register.disabled=false
  
}
 }
</script>
</head>
 
<body>
 
 <p>Site registeration:
 <ul>
 <li>
 Term1.
 </li>
 <li>
 Term2.
 </li>
 <li>
 Term3.
 </li>
 </ul>
 </p> 
 <form name="checkdiv" action="#" >
 <input type="checkbox" name="termscheck" onchange="allowSubmit()">I agree to these terms.
 <br>
 <input type="button" value="register"  name="register" disabled="disabled">
 </form>
</body>
 </html>




Post a reply
  Related Posts  to : disable button
 Disable submit button until all form's fields are filled     -  
 Convert link and button to custom button with good style     -  
 disable right click on your web page     -  
 Disable TextBox html by php     -  
 how to disable JavaScript in Mozilla FireFox     -  
 Gel Button     -  
 Glare button     -  
 create web button     -  
 create button in asp.net     -  
 Nav button size     -  

Topic Tags

JavaScript Variables