bhuninghake
Programmer
I'm fairly new to programming and not sure if I'm asking the question correctly, supplying enough information to be understood, but here goes. I have an online store where ASP, JavaScript, Cookies and Session variables are used throughtout where info is stored in cookies and session variables. Everything seems to work correctly with different browsers on a PC but the MAC keeps dropping information passed via JavaScript. Everything seems to work correctly on the MAC until checkout time and then I can see an error stating that the elements are not an object, but yet I can make an alert window and the MAC will display the alert windows with the correct information. Is there some special code I need to add to my asp pages when dealing with the MAC?
The JavaScript works with all browsers on the PC. On the MAC I've tried IE and Netscape with no success.
The code is part of the checkout process. Here is the code. Notice the "alert tags" that I used in my tests where the MAC does show the alerts with the correct elements.
<script language="JavaScript">
function checkout()
{
//alert("here");
//var oChkout = document.frmCheckout;
var oChkout = document.getElementById("frmCheckout");
var oCart = document.getElementById("frmCart");
//alert("temp: " + oCart.id + ", " + oChkout.id);
//loop through the cart and update the checkout form with the latest values
// in case they have changed
var oItem
//for (var i = 0; i < document.frmCart.length; i++)
//BILL: LOOK HERE!!!
//for (var i = 0; i < oCart.length; i++)
for (var i = 0; i < oCart.elements.length; i++)
{
//<%
'Note: may need to do elements.length above. May be an issue with
' the .elements[name].value = value line...
%>
oItem = oCart.elements;
//alert( "Debug: " + oChkout.elements.length );
if( oItem != null )
{
//alert(oItem.name + ": " + oChkout.elements[oItem.name].value + " --> " + oItem.value);
oChkout.elements[oItem.name].value = oItem.value;
}
}
//for (var i = 0; i < oChkout.length; i++)
//{
// alert(oChkout.elements.name + ":" + oChkout.elements.value)
//}
oChkout.submit();
}
</script>
The JavaScript works with all browsers on the PC. On the MAC I've tried IE and Netscape with no success.
The code is part of the checkout process. Here is the code. Notice the "alert tags" that I used in my tests where the MAC does show the alerts with the correct elements.
<script language="JavaScript">
function checkout()
{
//alert("here");
//var oChkout = document.frmCheckout;
var oChkout = document.getElementById("frmCheckout");
var oCart = document.getElementById("frmCart");
//alert("temp: " + oCart.id + ", " + oChkout.id);
//loop through the cart and update the checkout form with the latest values
// in case they have changed
var oItem
//for (var i = 0; i < document.frmCart.length; i++)
//BILL: LOOK HERE!!!
//for (var i = 0; i < oCart.length; i++)
for (var i = 0; i < oCart.elements.length; i++)
{
//<%
'Note: may need to do elements.length above. May be an issue with
' the .elements[name].value = value line...
%>
oItem = oCart.elements;
//alert( "Debug: " + oChkout.elements.length );
if( oItem != null )
{
//alert(oItem.name + ": " + oChkout.elements[oItem.name].value + " --> " + oItem.value);
oChkout.elements[oItem.name].value = oItem.value;
}
}
//for (var i = 0; i < oChkout.length; i++)
//{
// alert(oChkout.elements.name + ":" + oChkout.elements.value)
//}
oChkout.submit();
}
</script>