Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Save the current page to an HTML file

Status
Not open for further replies.

ching0418

MIS
Mar 6, 2002
96
0
0
HK
hello friends!

is it possible to save the current page to an html page when the user clicks the submit button?

my purpose on doing this is to email the data entered on the page to a specific person when the user clicks the submit button.

if this is possible, how do we do this?

thanks in advance!
 
I assume what you are looking to do is to email an identical copy of the completed form with all formatting and data included so the email looks identical to the form correct?

Normally the way to do this would be to build a string of HTML that looks identical to the original form with the values plugged in and pass that string in a hidden form field to your ASP page then send your email as HTML using the passed HTML string as the body.

This get's a bit tiresome because you are actually building two copies of the form on your form page, one in HTML and one in code and if you make a change to the form you have to do it in both places.

I have been working on an automatic form email formatter script for just this purpose but it is written in Javascript.
When Submit is pressed on the form, my function executes, reads in the HTML of the area of the page you select to send as an email. It hides buttons, converts list boxes to Input fields with the selected value shown and sets the readonly or disabled property on all fields. It also reads in any inline styles, includes embeded page styles and class tags. The result is an email version of the page that has been locked down so the fields are not editable but retains the formatting of the original script as closely as possible.

If you are interested in trying it out I can post the code over in the Javascript forum. The script is still in-progress but it works well in most cases.


Paranoid? ME?? WHO WANTS TO KNOW????
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top