Código HTML:
Ver original
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <script> var checkobj function agreesubmit(el){ checkobj=el if (document.all||document.getElementById){ for (i=0;i<checkobj.form.length;i++){ //hunt down submit button var tempobj=checkobj.form.elements[i] if(tempobj.type.toLowerCase()=="submit") tempobj.disabled=!checkobj.checked } } } function defaultagree(el){ if (!document.all&&!document.getElementById){ if (window.checkobj&&checkobj.checked) return true else{ alert("Please read/accept terms to submit form") return false } } } </script> </head> <body> <form name="form" onSubmit="return defaultagree(this)"> Rest of your form here<br> <input type="text" name="user" value="" size="25"> <input type="text" name="pass" value="" size="25"> <input type="Submit" value="Submit!" disabled> </form> <script> //change two names below to your form's names document.forms.form.check.checked=false document.forms.form.user.checked=false document.forms.form.pass.checked=false </script> </body> </html>
y quiero poder usarlo que me funcione que si hay algun campo limpio no pueda utilizar el submit