View Full Version : Having a Form print instead of email...
KimHuff
07-22-2002, 08:16 PM
First let me say GREAT JOB to those at JavaScript Kit (formerly Website Abstract) for the wonderful new upgraded forum. :thumbsup:
Now, off to my question...
I am creating a site that needs a form. Unfortunately, this form is not to be emailed, sent, or transferred in any way. I would like for the visitors to fill out the form and click on submit. From that point the form, completed with all the answers, would open in a new window for printing. The printed version, along with their payment, can be mailed to the address provided.
Does anyone know if the FORM option can work in this way? If so, can some explain how I am to setup the form command?
Thank you in advance,
Kim
PS Hi John!! :D
bacterozoid
07-22-2002, 08:46 PM
Yes, I believe you could do this. You simply have a script that goes through all the form field values and writes them as text onto a new window. I am not good enough to write a script such as this, but I think it is possible.
Shift4Sms
07-23-2002, 01:12 AM
The simpliest would be to have an action page on your server format the information you would like printed. Once you have this page, simply add "target='_blank'" option to your form tag:
<form action="actionpage.asp" target="_blank">
<input name="firstname">
...
</form>
Also, this can be done with client side scripting but I don't usually recommend anything be 100% dependent on client side scripting.
KimHuff
07-23-2002, 01:51 AM
Thanks for your response, but I have a couple questions.
First, I understand the form code. It looks like a basic action script, but it is calling for an ASP page and that I know nothing about.
I can enter the script as you have suggested and will start making the actual form after i send this message. BUT how do i configure this actionpage.asp and how does it format the file?
Any assistance would be greatly appreciated.
Kim
Shift4Sms
07-23-2002, 01:59 AM
My example used .asp just because it is one of many popular server side scripting languages but any language will do, including straight CGI. I normally use ColdFusion (.cfm) and have very little experience with ASP.
What server side scripting languages do you have available?
If you have ColdFusion available, I could write you a template. Since what you are requesting is so simple, maybe someone else can write you a template in another language...
boxer_1
07-23-2002, 02:01 AM
You might be interested in having a look at this tutorial ;) :
http://www.javascriptkit.com/javatutors/send1.shtml
HalloweenFreak
07-23-2002, 02:14 AM
Hi,
If you don't want or need to get that serious about your actual form and just need something simple. Try using a hidden frame and html/javascript that will capture the form fields, remember them and transfer to the new page when submitted. Certainly no protection from any deviants as it is not a secure way of doing it, but you are not actually having it sent over the Internet anywhere. If that is correct than this would work fine.
Hope this helps,
Bye,
Allan
If you need more help on what I am saying, contact me through the forum :thumbsup:
KimHuff
07-23-2002, 08:21 PM
I am still not having any luck. If anyone can help, I would appreciate it.
www.tootntellit.com
Kim
KimHuff
07-23-2002, 08:46 PM
Steven,
I found out I do have ASP available and CGI. I dont know about ColdFusion.. I know less about it than i do ASP. :(
Kim
Shift4Sms
07-23-2002, 10:20 PM
I'm don't claim to be an expert in ASP but give this a try:
TestPrintForm.htm
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Test Print FORM</title>
</head>
<body>
<form action="TestPrintAction.asp" method="post" target="_blank">
<table border="0" cellspacing="2" cellpadding="2">
<tr>
<th align="right" valign="baseline">First Name</th>
<td valign="baseline"><input type="text" name="FirstName"></td>
</tr>
<tr>
<th align="right" valign="baseline">Last Name</th>
<td valign="baseline"><input type="text" name="LastName"></td>
</tr>
<tr>
<th align="right" valign="baseline">Plan</th>
<td>
<input type="radio" name="Plan" value="1" checked>1 Month for $99<br>
<input type="radio" name="Plan" value="3">3 Months for $199<br>
<input type="radio" name="Plan" value="6">6 Months for $399<br>
</td>
</tr>
<th align="right" valign="baseline"> </th>
<td>
<input type="submit" value="Submit">
<input type="reset" value="Reset">
</td>
<tr>
</tr>
</table>
</form>
</body>
</html>
TestPrintAction.asp
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Test Print ACTION</title>
</head>
<body>
<%
Response.Write "<table border=""0"" cellspacing=""2"" cellpadding=""2"">"
Response.Write " <tr>"
Response.Write " <th align=""right"" valign=""baseline"">First Name</th>"
Response.Write " <td valign=""baseline"">" & Request.Form("FirstName") & "</td>"
Response.Write " </tr>"
Response.Write " <tr>"
Response.Write " <th align=""right"" valign=""baseline"">Last Name</th>"
Response.Write " <td valign=""baseline"">" & Request.Form("LastName") & "</td>"
Response.Write " </tr>"
Response.Write " <tr>"
Response.Write " <th align=""right"" valign=""baseline"">Plan</th>"
Response.Write " <td>"
if Request.Form("Plan") = "1" then
Response.Write " 1 Month for $99"
elseif Request.Form("Plan") = "3" then
Response.Write " 3 Months for $199"
elseif Request.Form("Plan") = "6" then
Response.Write " 6 Months for $399"
else
Response.Write " UNKNOWN PLAN (" & Request.Form("Plan") & ")"
end if
%>
</body>
</html>
The above source code is also attached in a zip file...
tommysphone
07-26-2002, 02:31 PM
More than possible. Simple to.
Create a form that opens in a new window - format and lay it out nicely and have a print and reset button at the end. That way, they fill out the form, print it and mail it just as you need.I hope this answers your question.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.