/    Sign up×
Community /Pin to ProfileBookmark

Hi there. Sorry to post again! hehehe.

At the moment, i have a section of my site which has an application form – the front of this “section” is a terms page, which at the moment I have just an “I Accept” and “I decline” <a href=”..”> to take the user to the application.

Is there a way to have a checkbox to say that they’ve read the terms and a button to “Accept” which would send them to another page? I’ve seen on other sites the button is “faded” until the terms are accepted. Is it possible to achieve this?

Many thanks!

to post a comment
HTML

3 Comments(s)

Copy linkTweet thisAlerts:
@CharlesOct 25.2003 — [font=georgia]It's easily done but you have to be careful. If you set the button as "disabled" with HTML then people without JavaScript will never be able to submit the form.[/font]

[font=monospace]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"

"http://www.w3.org/TR/html4/strict.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<meta name="Content-Script-Type" content="text/javascript">

<title>Example</title>

<style type="text/css">

<!--

fieldset {float:left; padding:1ex}

label {display:block; text-align:center}

input {margin-right:1ex}

button {clear:left}

-->

</style>

<script type="text/javascript">

<!--

onload = function () {document.getElementById('reallyAccept').disabled = true}

// -->

</script>

<form action="">

<div>

<fieldset>

<legend>Terms</legend>

<textarea>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipitlobortis nisl ut aliquip ex ea commodo consequat.</textarea>

<label><input type="checkbox" onclick="this.form.reallyAccept.disabled = !this.checked">I accept</label>

</fieldset>

<button type="submit" id="reallyAccept">Submit</button>

</div>

</form>[/font]
Copy linkTweet thisAlerts:
@DanUKauthorOct 25.2003 — Thanks very much!

How about just a normal button for another page which takes them to another page?

I.e. clicking a button labelled "Go" takes them back to index.php?
Copy linkTweet thisAlerts:
@CharlesOct 25.2003 — [font=georgia]It's a form. Simply supply the desired URL as the value of the FORM element's "action" attribute.[/font]
×

Success!

Help @DanUK spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.27,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...