Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Enabling a Submit Button

Status
Not open for further replies.

paddler1222

Technical User
Oct 9, 2008
3
US
I've created a job application form (Name/ID: Application) using GoLive CS2 and have disabled the Submit Button (Name: Submit Button/Label"Submit Application) in the Inspector so it is inactive when the page loads. I want to enable it when an applicant clicks on a check box (Name: Info Certified/Value: Yes) at the end of the form. Can someone help me with this?
Thanks.
 
You need to make and attach a javascript to the checkbox that changes the status of the submit button when checked.
 
Thanks again. I'm a complete rookie, so is there any chance you can provide me with the javascript for this? Or maybe an example that I can modiify. I've found some out there in cyberspace, but given my lack of experience, I can't figure out how to modify it and where to put it.

 
I was bored today so i wrote a little script for you.

Code:
<head>
<script>
function checkSpodTermsBox()
{
	if (document.spodemail.terms.checked)
	{
		document.spodemail.submit.disabled = false;
	}
	else
		document.spodemail.submit.disabled = true;
}
</script>
</head>


<body>
<form name="spodemail" action="" method="post">

<input name="terms" onclick="checkSpodTermsBox()" checked="true" type="checkbox">

<input name="submit" value="Submit" type="submit">
</body>

Place the script part inside the head of your page.
Your form needs to have a name, here i'm using spodemail.
Your checkbox needs a name, i'm using terms, and an onclick event to call the script that's in the page head.
There's nothing unusual about the submit button.

The names of things are very important. It won't work if they don't match.

Here's three lines of the script:

if (document.spodemail.terms.checked)
document.spodemail.submit.disabled = false;
document.spodemail.submit.disabled = true;

The names spodemail and terms must match the names given to your form and checkbox items respectively.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top