Print Page | Close Window

Multiple checkboxes for accept terms form

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=6263
Printed Date: 31 March 2026 at 3:07pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Multiple checkboxes for accept terms form
Posted By: Pixel
Subject: Multiple checkboxes for accept terms form
Date Posted: 08 October 2003 at 12:20pm

Greetings....

I have a script that will enable the my "Accept Terms" submit button when the checkbox is clicked on the registration_rules in WWF .... works fantastic... But I have several check buttons I'd like to force users to click on in order to enable the Accept terms button. With the following script any checkbox selected enables the accept button, how do I force the button to be enabled only when ALL checkboxes are checked?

Any help is wildly appreciated, thanks!

<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
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>


<form method="post" name="frmregister" action="register.asp?FID=<% = intForumID %>" onClick="agreesubmit(this)">




Replies:
Posted By: MorningZ
Date Posted: 08 October 2003 at 3:01pm
So do a http://www.morningz.com/sections/playground/files/code/check.html - view source on this page for some script that does as you ask :-)

-------------
Contribute to the working anarchy we fondly call the Internet


Posted By: Pixel
Date Posted: 08 October 2003 at 3:21pm

That works great.... however....
How do I then process the original button value...

value="<% = strTxtAccept %><% = srtTxtAccept %>"

into that function to process the form?
<% = srtTxtAccept %><% = srtTxtAccept %>



Posted By: MorningZ
Date Posted: 08 October 2003 at 3:29pm

you would remove the "onSubmit" event from the <form> tag and set the "action" parameter like you normally would...

the "Value" you show above has zero impact on any of the form action stuff, thats just the text that gets put into the button



-------------
Contribute to the working anarchy we fondly call the Internet


Posted By: Pixel
Date Posted: 08 October 2003 at 3:48pm
Oops...   Thanks!



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net