Its me again Can you set a cookie to any type of form, ie: add it up form

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

scootertiki

Thread Starter
Joined
Oct 10, 2001
Messages
38
Hey I am still having trouble taking info from a form to a printable page. Now I want to take the simple add it up form that I have and transfer all the items they add up and the total to a printable page. Are cookies the way to go. Should I set a cookie and retrieve it, and how do I set a cookie to the javascript that calculates my total?

Here is my add up form.<FORM NAME="MyForm">
P>Size<SELECT NAME="size" SIZE="1" ONCHANGE="totalPrice()">
OPTION VALUE="0" SELECTED="SELECTED">-- Select --/OPTION><OPTION
VALUE="2400">4' x 4'</OPTION><OPTION VALUE="3550">4' x 6'/OPTION><OPTION VALUE="4125">4' x 8'</OPTION><OPTION VALUE-"4700">6' x 6'</OPTION>
OPTION VALUE="6300">8' x 8'</OPTION><OPTION VALUE="7900">8' x 12'</OPTION></SELECT>
/P>
P>Ceiling Height-(at least 8'?)<SELECT NAME="ceiling" SIZE="1" ONCHANGE="totalPrice()">
OPTION VALUE="0" SELECTED="SELECTED">-- Select --/OPTION><OPTION
VALUE="0">Yes</OPTION><OPTION VALUE="0">No</OPTION></SELECT>
/P>
P>Door Hinge <SELECT NAME="hinge" SIZE="1" ONCHANGE="totalPrice()">
OPTION VALUE="0" SELECTED="SELECTED">-- Select --/OPTION><OPTION
VALUE="0">Left</OPTION><OPTION VALUE="0">Right</OPTION></SELECT>
/P>
P>1' x 2' Door Window<SELECT NAME="window" SIZE="1" ONCHANGE="totalPrice()">
OPTION VALUE="0" SELECTED="SELECTED">-- Select --/OPTION><OPTION
VALUE="0">Yes</OPTION><OPTION VALUE="56">Exchange for 3' x 3'</OPTION><OPTION VALUE="280">Door window & 3' x 3'</OPTION></SELECT>
/P>
P>Caster Wheels <SELECT NAME="wheels" SIZE="1" ONCHANGE="totalPrice()">
OPTION VALUE="0" SELECTED="SELECTED">-- Select --/OPTION><OPTION
VALUE="0">No</OPTION><OPTION VALUE="200">Yes</OPTION></SELECT>
/P>
P>Sub Floor Foam<SELECT NAME="subfloor" SIZE="1" ONCHANGE="totalPrice()">
OPTION VALUE="0" SELECTED="SELECTED">-- Select --/OPTION><OPTION
VALUE="0">Yes</OPTION><OPTION VALUE="0">No</OPTION></SELECT>
/P>
P>Ventilation System<SELECT NAME="vent" SIZE="1" ONCHANGE="totalPrice()">
OPTION VALUE="0" SELECTED="SELECTED">-- Select --/OPTION><OPTION
VALUE="0">Yes</OPTION><OPTION VALUE="0">No</OPTION></SELECT>
/P>
P>Vent Fan Size<SELECT NAME="fan" SIZE="1" ONCHANGE="totalPrice()">
OPTION VALUE="0" SELECTED="SELECTED">-- Select --/OPTION><OPTION
VALUE="0">Recording</OPTION><OPTION VALUE="0">Practicing</OPTION></SELECT>
/P>
P>Fluorescent Light<SELECT NAME="light" SIZE="1" ONCHANGE="totalPrice()">
OPTION VALUE="0" SELECTED="SELECTED">-- Select --/OPTION><OPTION
VALUE="0">Yes</OPTION><OPTION VALUE="0">No</OPTION></SELECT>
/P>
Total Price<INPUT TYPE="TEXT" NAME="total">
/P>
/FORM>
SCRIPT LANGUAGE="JavaScript"
var price1 = 0 ;
var price2 = 0 ;
var price3 = 0 ;
var price4 = 0 ;
var price5 = 0 ;
var price6 = 0 ;
var price7 = 0 ;
var price8 = 0 ;
var price9 = 0 ;
var price10 = 0 ;
var price11 = 0 ;
var price12 = 0 ;
var price13 = 0 ;
var price14 = 0 ;
var totalprice = 0 ;

function totalPrice() {
price1 = parseInt (document.MyForm.size.value );
price2 = parseInt (document.MyForm.ceiling.value );
price3 = parseInt (document.MyForm.hinge.value );
price4 = parseInt (document.MyForm.window.value );
price5 = parseInt (document.MyForm.wheels.value );
price6 = parseInt (document.MyForm.subfloor.value );
price7 = parseInt (document.MyForm.vent.value );
price8 = parseInt (document.MyForm.fan.value );
price9 = parseInt (document.MyForm.light.value ); totalprice = price1 + price2 + price3 + price4 + price5 + price6 + price7 + price8 + price9
document.MyForm.total.value = totalprice

Any suggestions?? I am pulling my hair out over this one!



:confused:
 
Joined
Aug 12, 2001
Messages
213
What scripting languages can you use on your server?


If you can use ASP is is a simple matter of (on your target page - saved with the .asp extension) calling the value like this:

Code:
&lt;%= request.form("total price")%&gt;
 

scootertiki

Thread Starter
Joined
Oct 10, 2001
Messages
38
My server only supports apache asp, and perl5 and php5 i believe.
I dont know anything about apache asp. I definitely in between a rock and a hard place. What I am trying to do, seems fairly simple, but I have yet to get a workable solution.

Thanks,
Liz
 

scootertiki

Thread Starter
Joined
Oct 10, 2001
Messages
38
im not so sure about that, because my host said that i must understand that apache asp is not the same as microsoft asp.

But, to try your suggestion, would I need to put anything else on the additup page? How would i link them?? Sorry, just i dont understand the steps.

Thanks,
Liz
 
Joined
Aug 12, 2001
Messages
213
have your form action point to "test.asp".


Code:
&lt;form method="post" action="test.asp"&gt;
your form goes here
&lt;/form&gt;
Then... in test.asp try this to see if it works:

Code:
&lt%=request.form("oneofyourformfieldnamesgoeshere")%&gt;
If it works, you should see the value printed out when you call the test.asp page from the browser.

I checked a site about apache asp and I see that it basically runs perl scripts inside the asp tags. I know nothing about Perl....so it this doesn't work I'm out of my league!

But this link might help:

http://asp.startcom.org/eg/response.asp
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

Top