Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Netscape Compatible??

Status
Not open for further replies.

BobTB

Technical User
Oct 28, 2002
37
AU
I have this code to write the data to a printable page....It opens a printable window in IE6 but wont open when using NS 7....Can some help me to make this section of code Netscape compatible??

Thanks

<Script>
function ShowPrint(){
var list = &quot;&quot;;
var Total = 0;

list += &quot;<html><body><table width='100%' cellspacing='1' cellpadding='2'
border='0'>\n&quot; +
&quot;<tr>\n&quot; +
&quot;<td width='10%' bgcolor='#000080'><b><font color='#ffffff'
face='Verdana' size='1'>Qty.</font></b></td>\n&quot; +
&quot;<td width='40%' bgcolor='#000080'><b><font color='#ffffff'
face='Verdana' size='1'>Product Description</font></b></td>\n&quot; +
&quot;<td width='10%' bgcolor='#000080'><b><font color='#ffffff'
face='Verdana' size='1'>ID</font></b></td>\n&quot; +
&quot;<td width='20%' bgcolor='#000080'><b><font color='#ffffff'
face='Verdana' size='1'>Each</font></b></td>\n&quot; +
&quot;<td width='20%' bgcolor='#000080'><b><font color='#ffffff'
face='Verdana' size='1'>Sub Total</font></b></td>\n&quot; +
&quot;</tr>\n&quot;;

for (var i=0; i < pArray.length; i++) {
var sArray = SplitString(pArray, 13, &quot;|&quot;)
if (sArray[0] != &quot;0&quot;) {
var sTmp = sArray[1]
list += &quot;<tr>\n&quot; +
&quot;<td width='10%' bgcolor='#c0c0c0'><font color='#000000'
face='Verdana' size='1'>&quot;+sArray[0]+&quot;</font></td>\n&quot; +
&quot;<td width='10%' bgcolor='#c0c0c0'><font color='#000000'
face='Verdana' size='1'>&quot;+sArray[2]+&quot;</font></td>\n&quot; +
&quot;<td width='10%' bgcolor='#c0c0c0'><font color='#000000'
face='Verdana' size='1'>&quot;+sTmp+&quot;</font></td>\n&quot; +
&quot;<td width='10%' bgcolor='#c0c0c0'><font color='#000000'
face='Verdana' size='1'>$&quot;+formatNum(sArray[3], 2)+&quot;</font></td>\n&quot; +
&quot;<td width='10%' bgcolor='#c0c0c0'><font color='#000000'
face='Verdana' size='1'>$&quot;+formatNum(sArray[0]*sArray[3], 2)+&quot;</font></td>\n&quot; +
&quot;</tr>\n&quot;;
Total += sArray[0]*sArray[3];
}
}

Total = formatNum(Total, 2);

list += &quot;</table>&quot;;
var nametitle = &quot;&quot;;
if(document.all.MR.checked) { nametitle = &quot;Mr.&quot;; }
if(document.all.MISS.checked) { nametitle = &quot;Miss.&quot;; }
if(document.all.MS.checked) { nametitle = &quot;Ms.&quot;; }
if(document.all.MRS.checked) { nametitle = &quot;Mrs.&quot;; }
if(document.all.DR.checked) { nametitle = &quot;Dr.&quot;; }

list += &quot;<br><b><font color='#000000' face='Verdana' size='1'>&quot; + nametitle
+ &quot; &quot; + document.all.FirstName.value + &quot; &quot; + document.all.Surname.value
+ &quot;<br>&quot; + document.all.PostalAddress.value + &quot;<br>&quot; + document.all.State.value
+ &quot;, &quot; + document.all.ZipCode.value + &quot;<br><br><input type='button'
name='confirm' value='Print' onclick='window.print()'>\n<br>&quot; + Total
+ &quot;</body></html>&quot;; // This is the print page
Invoice = window.open
(&quot;&quot;,&quot;Invoice&quot;,&quot;height=400,width=600,top=10,left=10,scrollbars=yes,resizable=yes&quot;
);
Invoice.document.write(list);

}
</Script>
 
pArray and sArray have to be defined before they are called. Is this a borrowed script?

I would check to see if these values are defined somewhere else on the page.

Thanks
Tricia
yorkeylady@earthlink.net
 
It is part of a shopping cart script. This section of code has been added on recently to provide a printable page but it wont open the print page in netscape 7. The shopping cart script works ok in NS but not this section of code for printing. Can it have code added to this section so that it works in NS?
 
Can someone let me know if they can help.....it is getting urgent.....Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top