susoxty
12-30-2005, 06:09 PM
I have a fairly simple question regarding a simple form i am creating.
In the form, there is to be one "input", which is a "download" link.
When the user clicks that link, it prompts a "Save Picture" dialog box, where the user can download the image to their computer.
What I want to do is create some sort of form validation, where in the "Save Picture" dialog box, if the user selects save and saves it to his/her computer, he/she is brought to a thank you page. If he/she clicks "cancel" nothing happen and the page should return false back to its orginal state. Any help will be greatly appreciated. Here is the current code. I know it's incomplete and a mess!
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Cadillac Surprise & Delight</title>
</head>
<body>
<!--
/* This is the function that opens the 'save as' dialogue box in IE. */
/* It appears to fail gracefully in mozilla-based browsers but hsa not */
/* been fully tested */
-->
<script language="JavaScript">
function checkform()
{
if (value of first field is or isn't something)
{
return false;
}
return true;
}
</script>
<form action="" onSubmit="return checkform()">
<div>
<div class="thumb_img"><img src="/images/US/en/cadillac_surprise/thumb.jpg" border="0"></div>
<div class="thumb_txt"><a href="thankyou.html" onClick= return false">Download</a></div>
</div>
</form>
In the form, there is to be one "input", which is a "download" link.
When the user clicks that link, it prompts a "Save Picture" dialog box, where the user can download the image to their computer.
What I want to do is create some sort of form validation, where in the "Save Picture" dialog box, if the user selects save and saves it to his/her computer, he/she is brought to a thank you page. If he/she clicks "cancel" nothing happen and the page should return false back to its orginal state. Any help will be greatly appreciated. Here is the current code. I know it's incomplete and a mess!
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Cadillac Surprise & Delight</title>
</head>
<body>
<!--
/* This is the function that opens the 'save as' dialogue box in IE. */
/* It appears to fail gracefully in mozilla-based browsers but hsa not */
/* been fully tested */
-->
<script language="JavaScript">
function checkform()
{
if (value of first field is or isn't something)
{
return false;
}
return true;
}
</script>
<form action="" onSubmit="return checkform()">
<div>
<div class="thumb_img"><img src="/images/US/en/cadillac_surprise/thumb.jpg" border="0"></div>
<div class="thumb_txt"><a href="thankyou.html" onClick= return false">Download</a></div>
</div>
</form>