Quote:
Originally Posted by CircleOfLinks
Hi guys,
im looking for someone who could help me with a problem im having with my site, if you go to http://www.aussiepages.com.au/coupon.php and check the box's in FireFox they change and add up 19 X howver many box they choose and then 'checkout' works however if you go to it in IE nothing happens when selecting the box's. even when you click the 'checkout' it only takes you to paypal. please if somebody can help ill pay you $40US for it if you can fix it for me.
please reply, pm or email me at support@aussiepages.com.au if you can help.
basically I really need it to do this. the go to the site, select a category they wish to sponsrer then checkout and be re-directed to a form.
thanks
|
The problem is a nested form, which means that I.E. (and Opera) cannot address the checkboxes properly.
The form named 'paypal' starts at line 520 but there is a form nested within it starting at line 546, and ending at line 1085.
The 'paypal' form ends at line 1343.
Remove the nested form and it should be fine.
There is also a problem with the dobasket function, in that it fails to check that split has returned the expected value, which means an error when the last checkbox is unchecked.
This version fixes the problem - note the lack of eval.
Code:
function dobasket()
{
clearbasket();
var totalitems;
var output;
var total;
var basketsize;
basketsize = 0;
total = 0.00;
output = '';
totalitems = 41;
document.getElementById('basket').innerHTML='';
for(var x=1; x<=totalitems; x++)
{
if(document.getElementById('item'+x).checked==true)
{
basketsize += 1;
var itemstring = document.getElementById('item'+x).value;
thisitem = itemstring.split('|');
if(thisitem && thisitem.length==2)
{
output = output + thisitem[0] + " £" + thisitem[1] + "<br />";
total += parseFloat(thisitem[1]);
document.forms['paypal']['item_name_'+ basketsize].value=thisitem[0];
document.forms['paypal']['item_number_' + basketsize].value=basketsize;
document.forms['paypal']['amount_' + basketsize].value=thisitem[1];
}
}
}
if(output==''){
document.getElementById('basket').innerHTML = '<i>There are currently no items in your basket</i>';
document.forms['paypal'].amount.value=thisitem[1] = 0.00;
}else{
document.getElementById('basket').innerHTML = output + "<br/>Total: £" + round(total, 2);
document.forms['paypal'].amount.value=thisitem[1] = round(total, 2);
}
}
There's also an error being generated by this section of code, which is trying to access a non-existent element with the ID 'nav':
Code:
sfHover = function()
{
var sfEls = document.getElementById("nav").getElementsByTagName("li");
for (var i=0; i<sfEls.length; i++) {
sfEls[i].onmouseover=function() {
this.className+=" sfhover";
}
sfEls[i].onmouseout=function() {
this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
}
}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
Unless you intend to add such an element, I would remove this code.
Last edited by logic ali; 08-19-2007 at 11:33 AM..
|