|
| |
|
|
Mozie
Posts: 90 Joined: 6/6/2005 Status: offline
|
Need a script for a "submit and print" button - 6/7/2005 7:19:41
I've searched the forum and FAQs but can't seem to find exactly what I'm looking for. I hope I'm not duplicating here! Apologies if I am I need a script for a "submit and print" button so the form results are emailed to me and then the user is prompted automatically (a pop up) to print the form for reference purposes. Hope someone can help! Thanks
|
|
|
|
rdouglass
Posts: 9280 From: Biddeford, ME USA Status: offline
|
RE: Need a script for a "submit and print" bu... - 6/7/2005 14:15:42
Hi and Welcome to OutFront. I use a JavaScript in the <head> like so: <SCRIPT LANGUAGE="JavaScript"> <!-- Begin function printWindow() { bV = parseInt(navigator.appVersion); if (bV >= 4) window.print(); } // End --> </script> Then anywhere you want to print the page, use a link calling the script like so: <a href="javascript:printWindow()">Print</a> or to automatically get the Print dialogue, put this at the bottom of the page: <SCRIPT LANGUAGE="JavaScript"> <!-- javascript:printWindow(); // --> </SCRIPT> Now if you put that script just above at the bottom of a results page (after the DB update has been done), that should get you close to what you're trying to do. AT least that's how I do it. Hope it helps. EDIT: This requires ver 4 or higher browsers.
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
|
|
Larry M.
Posts: 2834 Joined: 2/20/2003 From: Greenville, South Carolina, USA Status: offline
|
RE: Need a script for a "submit and print" bu... - 6/9/2005 7:23:43
quote:
BUT, the results are not emailing to me! Mozie, Did you answer "No" to the email dropdown Form Properties box in response to "Would you like to remove the e-mail recipient?" Did you Publish, not FTP, files to your host server? Do you have FrontPage Extensions loaded on your host server?
_____________________________
Larry M. Reality is the leading cause of stress among those few in touch with it
|
|
|
|
Mozie
Posts: 90 Joined: 6/6/2005 Status: offline
|
RE: Need a script for a "submit and print" bu... - 6/9/2005 8:45:13
Hi there In answer to your Questions, No, No and Yes. I used an existing form but in trying to get it to send the results to another page, I've messed something up! Thank you
|
|
|
|
Larry M.
Posts: 2834 Joined: 2/20/2003 From: Greenville, South Carolina, USA Status: offline
|
RE: Need a script for a "submit and print" bu... - 6/9/2005 9:14:09
quote:
In answer to your Questions, No, No and Yes. I used an existing form but in trying to get it to send the results to another page, I've messed something up! Mozie, Correct answers are Yes, Yes and Yes. Edit: Since you answered "No" to question 2, you may (probably) have corrupted FP extensions.
< Message edited by Larry M. -- 6/9/2005 10:35:34 >
_____________________________
Larry M. Reality is the leading cause of stress among those few in touch with it
|
|
|
|
AMysticWeb
Posts: 855 Joined: 10/23/2002 Status: offline
|
RE: Need a script for a "submit and print" bu... - 6/10/2005 3:20:13
Hi Mozie, First off, if you are having problems with your form, a URL for the form page might help. As to the print button, I like to create a custom confirmation page, placing the content IN <Div> working with the following script. http://personalweb.about.com/od/copypastejavascripts/a/404_3scripts_3.htm
_____________________________
Hope I have been of some help, Micheal [URL=http://web.archive.org/web/20060101013129/http://www.frontpageforms.com/]FrontPageForms.com-Archive Version[/URL] I am living Proof that Viral Procrastination exists!
|
|
|
|
kevin3442
Posts: 197 Joined: 1/25/2005 From: Nebraska, USA (home of the once-mighty Huskers) Status: offline
|
RE: Need a script for a "submit and print" bu... - 6/10/2005 14:32:53
Hi Mozie, quote:
ORIGINAL: rdouglass If you're starting from scratch, this application does lend itself well to JavaScript. I agree with Roger. Seems that you could use javascript for this. I don't think you'd even need to bother with finding a canned script on the web. It should be a fairly straight-forward script... if you know javascript. That's the catch of course; do you know javascript? quote:
ORIGINAL: Mozie I need a script for a "submit and print" button so the form results are emailed to me and then the user is prompted automatically (a pop up) to print the form for reference purposes. How about reversing it. I.e., give them the option of printing the form for reference before it is submitted. That would be pretty straight-forward to code in javascript. Instead of the standard "Submit" button in the form, you replace it with something like: <input type="button" value="Submit" onclick="submitForm(this.form)"> The submitForm() function would (1) use a confirm() dialog to offer the user the option to print the form before it is submitted, then (2) submit the form. If you want to try this approach, holler if you need help with the coding and I'll be happy to give you a hand. Cheers, Kevin
|
|
|
|
rdouglass
Posts: 9280 From: Biddeford, ME USA Status: offline
|
RE: Need a script for a "submit and print" bu... - 6/13/2005 9:15:58
Can you post the code of that page?
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
|
|
Mozie
Posts: 90 Joined: 6/6/2005 Status: offline
|
RE: Need a script for a "submit and print" bu... - 6/13/2005 9:25:48
Here it is: <html>
<head>
<title>Test submit and print</title>
</head>
<body>
<p>Test submit and print</p>
<form method="POST" action="print.asp" name="FrontPage_Form1">
<input type="hidden" name="address" value="webmaster@rae.co.za" ID="Hidden1">
<p><input type="text" name="testing1" size="20"></p>
<p><input type="text" name="testing2" size="20"></p>
<p><input type="text" name="testing3" size="20"></p>
<p><input type="submit" value="Submit" name="B1"></p>
</form>
<p> </p>
</body>
</html> ************************************* And this form sends the input to this form which prompts you to print: <html>
<head>
<meta http-equiv="Content-Language" content="en-za">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>print</title>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function printWindow() {
bV = parseInt(navigator.appVersion);
if (bV >= 4) window.print();
}
// End -->
</script>
</head>
<body>
<font face="Verdana" size="1"><b></b></font><BR>
<font face="Verdana" size="1"><b></b></font><BR>
<font face="Verdana" size="1"><b></b></font><BR>
<SCRIPT LANGUAGE="JavaScript">
<!--
javascript:printWindow();
// -->
</SCRIPT>
</body>
</html>
|
|
|
|
rdouglass
Posts: 9280 From: Biddeford, ME USA Status: offline
|
RE: Need a script for a "submit and print" bu... - 6/14/2005 13:03:30
How about printing the form just before you submit? I think you should be able to use my original script and in your form tag do something like: <form method="POST" action="--WEBBOT-SELF--" onSubmit="printWindow();"> Other than that, the only way I know to do this is well "outside" the FrontPage 'bots and would require quite a bit of coding. We can go that way if you want.
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
|
|
AMysticWeb
Posts: 855 Joined: 10/23/2002 Status: offline
|
RE: Need a script for a "submit and print" bu... - 6/15/2005 11:19:17
Hi Mozie, In my original post, this is what I proposed. Script Here If you use the FrontPage form handler to submit to a Custom Confirmation Page, you can select which portion of the page to print. I would create a custom confirmation page with a Thanks message and then include the fields you deem most important by utilizing ConfirmationFields. By using this script (which works quite well), the printable portion will appear in a new blank window for printing. I generally wouldn't include graphics in the printable portion, but would include the site name.
_____________________________
Hope I have been of some help, Micheal [URL=http://web.archive.org/web/20060101013129/http://www.frontpageforms.com/]FrontPageForms.com-Archive Version[/URL] I am living Proof that Viral Procrastination exists!
|
|
|
|
AMysticWeb
Posts: 855 Joined: 10/23/2002 Status: offline
|
RE: Need a script for a "submit and print" bu... - 6/17/2005 13:32:38
Hey Mozie, Good job! Glad we could be of some help.
_____________________________
Hope I have been of some help, Micheal [URL=http://web.archive.org/web/20060101013129/http://www.frontpageforms.com/]FrontPageForms.com-Archive Version[/URL] I am living Proof that Viral Procrastination exists!
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|