
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | <!DOCTYPE html> <html> <head> <meta charset= "utf-8" > <meta name= "viewport" content= "width=device-width, initial-scale=1.0" > <title>Javascript Disable button Terms and Conditions</title> <script language=javascript> function apply() { document.frm.sub.disabled=true; if (document.frm.chk.checked==true) { document.frm.sub.disabled=false; } if (document.frm.chk.checked==false) { document.frm.sub.enabled=false; } } </script> </head> <body> <form name= "frm" > <table style= "border:solid green 1px" > <tr><td align=center>I agree Terms and Conditions <input type= "checkbox" name= "chk" onClick= "apply()" ></td></tr> <tr><td align=center><input type= "button" name= "sub" value= "submit" disabled></td></tr> </table> </form> </body> </html> |