navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

Need a script for a "submit and print" button

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> General Web Development >> Need a script for a "submit and print" button
Page: [1]
 
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.

(in reply to Mozie)
Mozie

 

Posts: 90
Joined: 6/6/2005
Status: offline

 
RE: Need a script for a "submit and print" bu... - 6/9/2005 2:47:17   
Thanks. Ok, i'm doing something wrong because it HALF works. I fill in the form, click submit and the results pass to my print.asp page and the Print Dialogue box pops up and I can print the results. BUT, the results are not emailing to me! I'm not using a database, that's the next learning curve I intend to embark upon:)

Here's the code for the form:

<form method="POST" action="print.asp" onsubmit="return FrontPage_Form1_Validator(this)" name="FrontPage_Form1">
<input type="hidden" name="address" value="mozie@mydomain.com" 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>


HELP:)

(in reply to rdouglass)
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

(in reply to Mozie)
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

(in reply to Larry M.)
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

(in reply to Mozie)
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!

(in reply to Larry M.)
rdouglass

 

Posts: 9280
From: Biddeford, ME USA
Status: offline

 
RE: Need a script for a "submit and print" bu... - 6/10/2005 10:59:09   
As you can clearly see, there are many ways to do this. :)

What I would suggest is to "inventory" what tools and skills you have and try to apply what you already know. If you're starting from scratch, this application does lend itself well to JavaScript. You can use ASP, but you'll have to step out from the FrontPage 'bots a lot.

JavaScript may be a good choice because there are a lot of 'canned' scripts out there that can do almost all of what you want and can do this before you submit anything to the FP 'bots. So you could confirm everything right on the same page and keep the FrontPage stuff just the way it is.

Unfortunately, which ever methods you choose will require moving away from the FrontPage built-in tools - there will be some coding involved. Actually, that is a good thing.:)

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to AMysticWeb)
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

(in reply to Mozie)
Mozie

 

Posts: 90
Joined: 6/6/2005
Status: offline

 
RE: Need a script for a "submit and print" bu... - 6/13/2005 5:28:00   
Thanks, but the user won't even be aware that the results have been emailed.

I just cannot seem to get it to work like I need it to:). On submitting it's not emailing the results to me but it is prompting me to print. I need it to do both. Here's the url:

http://www.rae.co.za/advoc8/test_submit_and_print.asp

< Message edited by Mozie -- 6/13/2005 7:01:11 >

(in reply to kevin3442)
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.

(in reply to Mozie)
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>

(in reply to rdouglass)
rdouglass

 

Posts: 9280
From: Biddeford, ME USA
Status: offline

 
RE: Need a script for a "submit and print" bu... - 6/13/2005 9:36:38   
I'm sorry, but I see no code in there to email. :)

The form you're using only sends to the print.asp page and doesn't seem to use any emailing. SO it look as tho the email part is missing

This is what I see as you're options:

1. Use the FrontPage 'bots to email a submission and 'daisy-chain' the pages to get to a page to print the form.

2. Use an email component (on your host) to send the email.

However, might I suggest backing up a few steps and creating a simple form, then try to get it to email to you first. That can be done thru the 'bots for the simple ones.

See, I'm suggesting breaking this into pieces; first the email, then the print.

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to Mozie)
Mozie

 

Posts: 90
Joined: 6/6/2005
Status: offline

 
RE: Need a script for a "submit and print" bu... - 6/14/2005 1:35:56   
Thanks. I can get the form to email results to me, no problem, but how do I get the form to also send the results to my print page? Should my print page be .htm or can it be .asp?

Here's my "submit" page, called test_submit_and_print.htm:

<form method="POST" action="--WEBBOT-SELF--">
  <!--webbot bot="SaveResults" startspan S-Email-Address="webmaster@rae.co.za"
  S-Email-Format="TEXT/PRE" --><input TYPE="hidden" NAME="VTI-GROUP" VALUE="0"><!--webbot
  bot="SaveResults" endspan -->
  <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>


I'd really appreciate your help. Thanks:)

(in reply to rdouglass)
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.

(in reply to Mozie)
Mozie

 

Posts: 90
Joined: 6/6/2005
Status: offline

 
RE: Need a script for a "submit and print" bu... - 6/15/2005 1:20:37   
Hi there

Thanks again. I'd actually prefer to "submit" first then go to the "print" page. Have no idea how to do it but I don't want to take up so much of your time! But if you're able to help, it would be much appreciated. Thanks again:)

Mozie

(in reply to rdouglass)
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!

(in reply to Mozie)
Mozie

 

Posts: 90
Joined: 6/6/2005
Status: offline

 
RE: Need a script for a "submit and print" bu... - 6/17/2005 3:15:43   
THANK YOU THANK YOU THANK YOU!!!

It's working just brilliantly!!!:)


(in reply to AMysticWeb)
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!

(in reply to Mozie)
Page:   [1]

All Forums >> Web Development >> General Web Development >> Need a script for a "submit and print" button
Page: [1]
Jump to: 1





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