|
|||||||
| JavaScript JavaScript (not Java) Discussion and technical support, including AJAX and frameworks (JQuery, MooTools, Prototype...) |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
I am using DW MX2004 and MS Access. I have an insert form which works fine...HOWEVER, I want to make sure that users accepts the Terms & Conditions of our website before allowing them to post their inventoy. I have a checkbox on the form. If they check it then all is well and the insert will work as designed. IF they don't check it - I want an alert advising "You have choosen NOT to accept the Terms & Conditions of XXXX.com, so your inventory has NOT been posted." (obviously NOT update the dB) and take them back to our home page. I am new at this and trying to work it into the current code that DW writes. I can 'OnSubmit' call Javascript - but am lost at how to code it...have this so far... <script language="JavaScript" type="text/javascript">THANKS for any and all help!!! |
|
#2
|
||||
|
||||
|
Something like this:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>Terms & Conditions</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript">
function validate() {
if (!document.Update.Terms.checked) {
alert ("You have choosen NOT to accept the Terms & Conditions of XXXX.com, so your inventory has NOT been posted.");
location.href="http://www.XXXX.com/"; // your homepage
return false;
}
}
</script>
</head>
<body>
<form action="processForm.cgi" name="Update" onsubmit="return validate();">
<fieldset><legend>Terms & Conditions</legend>
<label for="Terms"><input type="checkbox" name="Terms" id="Terms">accept the Terms & Conditions</label>
<button type="submit">submit</button>
</fieldset>
</form>
</body>
</html>
__________________
At least 98% of internet users' DNA is identical to that of chimpanzees Last edited by Fang; 02-09-2007 at 03:04 AM. |
|
#3
|
|||
|
|||
|
Your Brilliant! Many, many thanks!
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|