this may ramble a bit………
my company supplies product information and pricing cds to customers. the cd is in a web based format and contains one page that is a shopping cart from which they can generate and fax an order. pricing varies between customers depending on how much business they do with us so each cd is unique.
for each part number (there are thousands) i store technical and pricing info in an array inside partnumberinfo.js as follows:
[CODE]partnumber[1] = new Array(“partnumber1″,”description”,”sellprice”,”re-sell price”,”other info”);
also in partnumberinfo.js i have a script to create the shopping cart elements.
now i am trying to reconfigure the cd so that the cart isn’t on one page, but each product description page will contain a price table for each part number related to that product.
so far i have:
*the HEAD tag references shoppingcart.js and partnumberinfo.js.
*each table row is configured as a shopping cart element (text box with ‘add to cart’ button).
i create the links in the price table as follows:
[CODE]<A HREF=java script:void(0)” onclick=”indpage(‘”+partnumber[i][0]+”‘);”>”+partnumber[i][0]+”</A>
which calls:
[CODE]function indpage(param) {
var insertedHTML = “<HTML><HEAD><SCRIPT SRC=”shoppingcart.js” language=”javascript”></SCRIPT><SCRIPT SRC=”partnumberinfo.js” language=”javascript”></SCRIPT></HEAD><BODY>”;
for (i=1;i<partnumber.length;i++) {
if (partnumber[i][0] == param) {
insertedHTML += param+”<BR>”+
“<FORM NAME=order>”+
“<input type=text size=10 maxlength=9 name=QUANTITY onChange=’this.value=CKquantity(this.value)’ value=”1” class=formFields><BR>”+
“<input type=hidden name=”PRICE” value=””+partnumber[i][2]+””>”+
“<input type=hidden name=”NAME” value=””+partnumber[i][1]+””>”+
“<input type=hidden name=”ID_NUM” value=””+partnumber[i][0]+””>”+
“<input type=hidden name=”SHIPPING” value=”0″>”+
“<input type=hidden name=”ADDITIONALINFO” value=””+partnumber[i][4]+””>”+
“<input type=button value=’Add’ style=”font-family: Verdana; font-size: 9px;” onClick=’AddToCart(this.form);’ class=formButton>”+
“</FORM>”;
}
}
var mywin = window.open(“”,””,” width=600,height=300,toolbar=yes,location=no,direc
tories=no,status=yes,scrollbars=yes,resizable=yes,
menubar=no”);
mywin.document.write(insertedHTML+”</BODY></HTML>”);
mywin.document.close();
}
i put the HEAD and SCRIPT ref’s in because i am thinking that since it’s opening a new page it will need the location of the script (i just guessed at this – i don’t know for sure).
here’s the problem:
the price table is created as planned, the part numbers are links and the new page opens displaying the part number and the textbox and ‘add to cart’ button, but i get an error when i try to use the ‘add’ button.
[CODE]Line:1
Char:1
Error:Object Expected
Code:0
any ideas??
all advice is greatly appreciated.
thanks.