Tech Support Guy banner
  • Please post in our Community Feedback thread for help with the new forum software! If you are having trouble logging in, please Contact Us for assistance.
Status
Not open for further replies.
1 - 7 of 7 Posts

·
Registered
Joined
·
38 Posts
Discussion Starter · #1 ·
I have a simple "add it up" form, that adds up different values. I would like to know how to transfer the selected information into a printable page. For instance, there are drop down menus, where someone chooses what they want, each choice has a value assigned to it, and then they can click calculate for the total. I would like the choices that are choosen to be transferred to a printable page, (a order confirmation type page). So there would be a page that the person could print out, that would not have the format of the drop-down menus. Is that possible, or would I need to have some scripting written for that???

Any suggestions are very appreciated!
Thanks,
Liz:p
 

·
Registered
Joined
·
1,741 Posts
If you have the code to this program, it'd help
to post it. :)
 

·
Registered
Joined
·
38 Posts
Discussion Starter · #4 ·
I am using front page, the form I have is javascript.

Here is the most important part of the script. The values that the person selects is what I want transferred in a simple format. Such as if they clicked on 4' x 4', 1 x 2 window, and no accessories. The display that I am after would look something like this:
SIZE: 4 x 4
Window: 1 x 2
Accessories: none
I took some tags out so that it would show the html language instead of the function, so I know there are some things missing, but you can get the basic idea.

Thank you for any help!

SCRIPT LANGUAGE="JavaScript"
!--
function AddItUp(form) {
var item, SIZE, WINDOW, ACCESSORIES;

// Get the value of the item that's selected in the first list
item = form.SIZE.selectedIndex;
SIZEValue = eval(form.SIZE.options[item].value)

// Get the value of the item that's selected in the second list
item = form.WINDOW.selectedIndex;
WINDOWValue = eval(form.WINDOW.options[item].value)

// Get the value of the item that's selected in the third list
item = form.ACCESSORIES.selectedIndex;
ACCESSORIESValue = eval(form.ACCESSORIES.options[item].value)

// Add up the value and display the total
form.total.value = SIZEValue + WINDOWValue + ACCESSORIESValue
}
//-->
SCRIPT

HEAD

BODY MARGINWIDTH=0 MARGINHEIGHT=0 LEFTMARGIN=0 TOPMARGIN=0 BGCOLOR=#FFFFFF>

A NAME="top"></A>

SCRIPT LANGUAGE="JavaScript">
!--
var browserName = navigator.appName;
var browserVer = parseInt(navigator.appVersion);
if (browserName == "Netscape" && browserVer == 2) {
document.open();
document.write("
//-->
SCRIPT>

DIV STYLE="margin-left: 5px; font-family: Arial, Verdana, Helvetica, Geneva, 'MS Sans Serif'">

CENTER>


P>

CENTER>

FORM>

TABLE BORDER=0 CELLPADDING=2>
TR>
TD ALIGN=RIGHT>SIZE:

TD>
SELECT NAME="SIZE">
4' X 4'
4' X 6'
6' X 6'
SELECT>
TD>
TR>

TR>
TD ALIGN=RIGHT>WINDOW:[/TD]
TD>
SELECT NAME="WINDOW">
OPTION VALUE=0>1 X 2 door window
Exchange for 3 x 3 window
additional 3 x 3 window
SELECT>
TD>
TR>

TR>
TD ALIGN=RIGHT>ACCESSORIES:[/TD]
TD>
SELECT NAME="ACCESSORIES">
Handicap door and ramp
additional vent system
light
SELECT>
TD>
TR>
TR>
TD ALIGN=RIGHT>Total:[/TD]
TD>

INPUT
TYPE=TEXT
NAME=total
SIZE=7

TD>
TR>

TR>
TD ALIGN=CENTER COLSPAN=2>
INPUT
TYPE=BUTTON
NAME="cmdCalc"
VALUE="Calculate"
onClick=AddItUp(this.form)>

TD>
TR>
TABLE>
FORM>
CENTER>
HR>

address>
address>

TD>
BODY>

:p
 

·
Registered
Joined
·
21,334 Posts
You don't need to calculate values here it seems. All you need to do is pass the values that are in the selection boxes and pass them to another page. I know how to do it in ASP but not in java script.
 

·
Registered
Joined
·
21,334 Posts
I don't think active server pages will run on an Apache web server unless they have their own version. Not sure about the cookies though.
 
1 - 7 of 7 Posts
Status
Not open for further replies.
Top