View Full Version : retrieving images

10-26-2006, 11:13 PM

I'm editing two neat little javascripts that work together. At the bottom is the code;

The first one is called order.htm

This produces a table with a list of items and prices, with a check box for the user to select.

The second is called confirm-order.html

This receives the order and adds up the prices.

I'm trying to places images within the order.htm (so people can see a picture). I would then like for it to carry-over to the confirm-order.html page and display the pictures.

I like this script because it's not a full ecommerce package, but just a good price generator. But it would be great to have images.

If you have any ideas that would be great. The link is www.altusair.com/order.htm

Dan Williams

Order.htm code

<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red"><!-- Create an HTML order form similar to the one below.
The confirm-order.html address is your confirm page -->

<form name=orderform action="confirm-order.html">
(Just check the items you wish to order.)<p>
<table border=1 width="580">
<td width="20">
<input type=checkbox name=Item1A value="1A-....*15.00$"></td>

<!-- STEP TWO: Using this format, add an entry for each sale item

Each item must have a checkbox in the format above.

The value="" is where all the magic happens
Put the Item Number then a dash (-) then the
description (with underscores for any spaces)
then a star (*) then the cost, and end with
a dollar sign ($) like this: Repeat for each
item for sale. -->

<td width="15">1A</td>
<td width="139">&nbsp;</td>
<td width="255">Item 1 is a ....</td>
<td width="117">$15.00</td>
<td width="20">
<input type=checkbox name=item2A value="2A-Item_2_is_a_....*30.00$"></td>
<td width="15">2A</td>
<td width="139">&nbsp;</td>
<td width="255">Item 2 is a ....</td>
<td width="117">$30.00</td>
<td width="20">
<input type=checkbox name=item3A value="3A-Item_3_is_a_....*45.00$"></td>
<td width="15">3A</td>
<td width="139">&nbsp;</td>
<td width="255">Item 3 is a ....</td>
<td width="117">$45.00</td>
<td colspan="5" align=center width="570">
<input type=submit value="Order">


confirm-order.html code


image01= new Image()
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
function decodeString() {
valNum = new Array();
valData = new Array();
var string, length, dataCount, orderData, grandTotal;
string = "" + unescape(location.search);
string = string.substring(1,string.length);
length = location.search.length;
orderData = "";
dataCount = 1;
for (var c = 0; c < string.length; c++)
if (string.charAt(c).indexOf("&") != -1) dataCount++;

orderData = "<table border=1 width=400>";
orderData += "<tr><td>Item</td><td>Description</td><td>Cost</td></tr>";
grandTotal = 0;
for (var i = 0; i < dataCount; i++)
valNum[i] = string.substring(0,string.indexOf("="));
string = string.substring(string.indexOf("=")+1,string.length);
if (i == dataCount-1) valData[i] = string;
else valData[i] = string.substring(0,string.indexOf("&"));
ampd = valData[i].indexOf("&");
pipe = valData[i].indexOf("-");
star = valData[i].indexOf("*");
line = valData[i].indexOf("$");
itemnum = string.substring(0,pipe);
itemdsc = string.substring(pipe+1,star);
itemcst = string.substring(star+1,line);
string = string.substring(ampd+1,string.length);

orderData += "<tr>";
orderData += "<input type=hidden name=item" + (i+1) + "num value='" + itemnum + "'>";
orderData += "<input type=hidden name=item" + (i+1) + "dsc value='" + itemdsc + "'>";
orderData += "<input type=hidden name=item" + (i+1) + "cst value='$" + itemcst + "'>";
orderData += "<td>" + itemnum + "</td>";
orderData += "<td>" + itemdsc + "</td>";
orderData += "<td>" + itemcst + "</td>";
orderData += "</tr>";
grandTotal += parseInt(itemcst);
orderData += "<tr>";
orderData += "<td colspan=2 align=center>Total</td><td>" + grandTotal + ".00</td>";
orderData += "</tr>";
orderData += "<tr>";
orderData += "<td colspan=3 align=center><input type=submit value='Confirm Order!'> or <a href='javascript:history.go(-1)'>Go Back</a></td>";
orderData += "</tr>";
orderData += "<input type=hidden name=grandtotal value='$" + grandTotal + ".00'>";
orderData += "</table>";

function openThanks() {
window.open("confirm-order-thanks.html"); // Can be any "thank you" page
// End -->

<meta name="GENERATOR" content="Namo WebEditor v6.0">

<form method=post action="http://cgi.freedback.com/mail.pl" name="emailform">

<!-- Don't forget to change this to your email address! -->

<input type=hidden name=to value="aircare@altusair.com">
<input type=hidden name=subject value="** Order Form **">

<script language="JavaScript">
<!-- Begin
// End -->

<font face="arial, helvetica" size="-2">Free JavaScripts provided<br>
by <a href="http://javascriptsource.com">The JavaScript Source</a></font>

<!-- Script Size: 4.79 KB -->

10-27-2006, 03:18 AM

I really have no idea how to do what you're asking. However, it helps others if you put '[ code ] and [ /code ]' (with neither the spaces nor quotes) before and after your code. That way, your code is put into a box, like this:

code here...