hola a todos es que tengo esto
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"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> 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
}
}
}
<form name="form" onSubmit="return defaultagree(this)"> Rest of your form here
<br><input name="check" type="checkbox" onClick="agreesubmit(this)"><b>I agree to the above terms
</b><br> <input type="text" name="user" value="" size="25"> <input type="text" name="pass" value="" size="25"> <input type="Submit" value="Submit!" disabled>
//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
y quiero poder usarlo que me funcione que si hay algun campo limpio no pueda utilizar el submit