I have a form that i want to ensure is filled out correctly before the user is able to proceed.
<!-- m --><a class="postlink" href="http://chimp.cc/start.htm">http://chimp.cc/start.htm</a><!-- m -->
If the user fails to fill out the terms and conditions box with a "Yes"when the user clicks submit, i want a message to pop up to tell them to complete it.
and to return the user to that field for completion.
I honestly have no idea how to do this, can someone please help me.
I have attached the source code too.
Cheers
Andyarg!!
no doctype, css in a script tag, tables for layout...
and that's just the stuff that leaps out at me...
I'll clean it up and look over a quick solution for you, just hold tight.wow thanks a lot<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Content-Style-Type" content="text/css">
<title>Example</title>
<script type="text/javascript">
function check (f) {
if (!f.termsAndConditions.checked) {
alert ('There\'s no going forward without agreeing to my terms.')
f.focus()
return false
}
}
</script>
<style type="text/css">
form {margin:auto; padding:1em; width:20em}
fieldset {padding:1ex}
label {display:block; text-align:left}
input {margin-left:1em}
button {display:block; margin:1em auto 0}
</style>
</head>
<body>
<form action="contact-us.pl" onsubmit="return check (this)">
<fieldset>
<legend>Terms and Conditions</legend>
<label>I agree to the terms and conditions <input name="termsAndConditions" type="checkbox"></label>
<button type="submit">Send</button>
</fieldset>
</form>
</body>
</html>
<!-- m --><a class="postlink" href="http://chimp.cc/start.htm">http://chimp.cc/start.htm</a><!-- m -->
If the user fails to fill out the terms and conditions box with a "Yes"when the user clicks submit, i want a message to pop up to tell them to complete it.
and to return the user to that field for completion.
I honestly have no idea how to do this, can someone please help me.
I have attached the source code too.
Cheers
Andyarg!!
no doctype, css in a script tag, tables for layout...
and that's just the stuff that leaps out at me...
I'll clean it up and look over a quick solution for you, just hold tight.wow thanks a lot<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Content-Style-Type" content="text/css">
<title>Example</title>
<script type="text/javascript">
function check (f) {
if (!f.termsAndConditions.checked) {
alert ('There\'s no going forward without agreeing to my terms.')
f.focus()
return false
}
}
</script>
<style type="text/css">
form {margin:auto; padding:1em; width:20em}
fieldset {padding:1ex}
label {display:block; text-align:left}
input {margin-left:1em}
button {display:block; margin:1em auto 0}
</style>
</head>
<body>
<form action="contact-us.pl" onsubmit="return check (this)">
<fieldset>
<legend>Terms and Conditions</legend>
<label>I agree to the terms and conditions <input name="termsAndConditions" type="checkbox"></label>
<button type="submit">Send</button>
</fieldset>
</form>
</body>
</html>