954,198 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Help with this JAVA CODING

Hi All -

Can you please look at this code for me?

I need to be able to have this script LOAD A URL when the checkbox is checked and the SUBMIT is pressed....

Thanks so much!!! :)

<head>
<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
}
}
}
</head>

<body>
<form name="agreeform" onSubmit="return defaultagree(this)">
Here is form or text
<input name="agreecheck" type="checkbox" onClick="agreesubmit(this)"><b>I agree to the above terms</b>
<input type="Submit" value="Submit!" disabled>
</form>

<script>
//change two names below to your form's names
document.forms.agreeform.agreecheck.checked=false
</script>
</body>

jeepj27
Newbie Poster
20 posts since May 2005
Reputation Points: 10
Solved Threads: 0
 

You might want to ask this question over in the HTML, CSS and JavaScript forum.

hooknc
Posting Whiz in Training
219 posts since Aug 2005
Reputation Points: 11
Solved Threads: 8
 

that's javascript... javascript is not the same as java

amellie
Newbie Poster
4 posts since Sep 2006
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You