Hi,
On one section of my website, I ask my customers for their postal code and country. Shipping rates are loaded from another page once they enter these information and click on calculate link. Now, I want to remove the click button and once these information entered, I want users see loading image and load data immediately. I was wondering if that is possble and if there are any examples.
$(document).ready(function() {
$("#link").click(function() {
$.ajax({
type: "GET",
data: { PROCESS: "UPS", WEIGHT: "<%=Session("TotalWeight")%>", POSTALCODE: $(document.getElementsByName("ShippingPostalCode")).val(), COUNTRY: $(document.getElementsByName("ShippingCountry")).val() },
url: "content/checkout/step1/index.cs.asp",
success: function(output) {
$("#sonuc").html(output);
$("#sonuc").css("display", "block");
}
});
});
});
Quick update! I allowed my customers to store addresses for future use. If they have an address stored, they can copy and paste the address with one click. Here is the code for that:
function StoredData(){
$.get("includes/ajaxfunctions.asp?Process=checkout1", { QUERY: $(document.getElementsByName("CUSTOMERDETAILNAME")).val() }, function(data){
$("div.StoredData").html(data);
});
}
$(document).ready(function() {
$("input[name=ShippingPostalCode]").livequery("change", function() {
$.ajax({
type: "GET",
data: { PROCESS: "UPS", WEIGHT: "<%=Session("TotalWeight")%>", POSTALCODE: $(document.getElementsByName("ShippingPostalCode")).val(), COUNTRY: $(document.getElementsByName("ShippingCountry")).val() },
url: "content/checkout/step1/index.cs.asp",
success: function(output) {
$("#sonuc").html(output);
}
});
});
});