http://www.dynamicdrive.com/dynamici...acceptterm.htm
I love this script but I want to use a submit button that i have designed. I have the normal one and the disabled version
can anyone help????
http://www.dynamicdrive.com/dynamici...acceptterm.htm
I love this script but I want to use a submit button that i have designed. I have the normal one and the disabled version
can anyone help????
You can just give the button a class or id value and then style it however you want.
Good luck!
like this?
<input name="" type="image" value="Submit!" src="images/buttons/b_continuel_disable.gif" />
but then how will it go to the active button once I click on the checkbox?
Try:
HTML Code:<input class="button" type="Submit" value="Submit!" disabled>Good luck!Code:.button { background: url('images/buttons/b_continuel_disable.gif'); }
ok but how do i call to show another class when button is in enable mode?
Like this:
Code:.button { background: url('url'); } .button[disabled="true"] { background: url('images/buttons/b_continuel_disable.gif'); }
Jeremy | jfein.net
txs a lot but still it doesnt work
I am sending you the whpole code. what is wrong????
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style>
.buttons {color:#fff;border:1px solid #fff;background-color:#b46f02;}/*enable button must be in orange with white text*/
.buttons[disabled="true"] {color:#fff;background-color:#dcd5c0;}/*disable button must be in gray with white text*/
</style>
<script>
//"Accept terms" form submission- By Dynamic Drive
//For full source code and more DHTML scripts, visit http://www.dynamicdrive.com
//This credit MUST stay intact for use
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="agreeform" onSubmit="return defaultagree(this)">
Rest of your form here<br>
<input name="agreecheck" type="checkbox" onClick="agreesubmit(this)"><b>I agree to the above terms</b><br>
<input class="buttons" type="Submit" value="Submit!" disabled>
</form>
<script>
//change two names below to your form's names
document.forms.agreeform.agreecheck.checked=false
</script>
</body>
</html>
Sorry, do this:
Code:<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <style> .buttons {color:#fff;border:1px solid #fff;background-color:#b46f02;}/*enable button must be in orange with white text*/ .buttons[disabled="true"], .buttons[disabled] {color:#fff;background-color:#dcd5c0;}/*disable button must be in gray with white text*/ </style> <script> //"Accept terms" form submission- By Dynamic Drive //For full source code and more DHTML scripts, visit http://www.dynamicdrive.com //This credit MUST stay intact for use 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="agreeform" onSubmit="return defaultagree(this)"> Rest of your form here<br> <input name="agreecheck" type="checkbox" onClick="agreesubmit(this)"><b>I agree to the above terms</b><br> <input class="buttons" type="Submit" value="Submit!" disabled> </form> <script> //change two names below to your form's names document.forms.agreeform.agreecheck.checked=false </script> </body> </html>
Jeremy | jfein.net
Bookmarks