- Code: Select all
if (document.order.shipping[0].type == "radio") {
for (var i=0; i < document.order.shipping.length; i++)
{
if (document.order.shipping[i].checked)
{
var rad_val = document.order.shipping[i].value;
}
}
}
else {
var rad_val = document.order.shipping.value;
}
if (button == "8" && document.order.country.value != "US" && (rad_val == "XX" || rad_val == "YYY")) {
alert("International customers cannot choose USA ONLY shipping options");
return(false);
}
and...
- Code: Select all
var shippingaddress="";
var billingaddress="";
billingaddress = document.billing.Address.value;
shippingaddress = document.billing.ShipAddress.value;
if (shippingaddress.match(/PO Box/i)) {
error += "We cannot ship to a PO Box\n";
}
if (shippingaddress.match(/P.O. Box/i)) {
error += "We cannot ship to a PO Box\n";
}
if ((document.billing.usebilling != undefined) &&
(document.billing.usebilling.checked == true)) {
if (billingaddress.match(/PO Box/i)) {
error += "We cannot ship to a PO Box\n";
}
if (billingaddress.match(/P.O. Box/i)) {
error += "We cannot ship to a PO Box\n";
}
}
Is there a way these can be combined in a check-it JavaScript function for limiting the International customers to PayPal only? Has anyone come across this type of issue before?
Thanks in advance for any help.