Forum Moderators: open
Here is the code:
<script type="text/javascript">
function delivery_incart(shipd) {
if (document.bs.ra_psaZip.value == '') {
document.getElementById('txtGetShipDate').innerHTML = '*Estimated delivery date</strong> will be calculated after shipping information is entered.';
} else {
var xmlHttp;
xmlHttp = null;
try { // Firefox, Opera 8.0+, Safari
xmlHttp = new XMLHttpRequest();
}
catch (e) { // Internet Explorer
try {
xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e) {
try {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e) { //Ajax is not supported. Estimated Delivery Date not shown.
return false;
}
}
}
lzip = document.bs.zipcode.value;
if (document.bs.shippings[1].checked) {
url = '<?php echo $secure_url.'usps_standard.php?Date=';?>'+shipd+'&zipcode='+lzip;
}
if (document.bs.shippings[2].checked) {
url = '<?php echo $secure_url.'usps_priority.php?Date=';?>'+shipd+'&zipcode='+lzip;
}
if (document.bs.shippings[3].checked) {
url = '<?php echo $secure_url.'usps_express.php?Date=';?>'+shipd+'&zipcode='+lzip;
}
xmlHttp.onreadystatechange=function() {
if(xmlHttp.readyState==4) {
document.write(xmlHttp.responseText+'.');
}
}
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
}
</SCRIPT>