Results 1 to 6 of 6

Thread: [RESOLVED] My code works in IE but not chrome, why?

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2006
    Location
    Greater Manchester, UK
    Posts
    476

    Resolved [RESOLVED] My code works in IE but not chrome, why?

    If you follow this link, my fare calculator works if your using IE, but not if your using chrome. Why does this happen ?, i think its something to do with the maps API not loading proper.

    Also i have a problem with my if/else statements for set fares.

    function CheckSetFare() {
    var PickupTown = document.getElementById("input_3_city").value;//get town/city data from pickup
    var DestinationTown = document.getElementById("input_8_city").value;//get town/city data from destination
    var DestinationAddress = document.getElementById("j-destination").value;// get destination address data
    var PickupAddress = document.getElementById("j-address").value;// get pickup address data
    var InitFare = document.getElementById("initial-fare").value;
    if(PickupTown == "Heywood" && DestinationAddress == "Manchester Airport, UK"){InitFare = 25};//Heywood-ManA-£25.
    if(DestinationTown == "Heywood" && PickupAddress == "Manchester Airport, UK"){InitFare = 27};//ManA-Heywood-£27.
    if(DestinationTown == "Heywood" && PickupAddress == "Manchester Piccadilly Station, UK"){InitFare = 17};//Picc-Heywood-£17.
    if(PickupTown == "Heywood" && DestinationAddress == "Manchester Piccadilly Station, UK"){InitFare = 17};//Heywood-Picc-£17.
    if(DestinationTown == "Middleton" && PickupAddress == "Manchester Airport, UK"){InitFare = 23};//ManA-Midd-£23.
    if(PickupTown == "Middleton" && DestinationAddress == "Manchester Airport, UK"){InitFare = 25};//ManA-Midd-£25.
    if(DestinationTown == "Castleton" && PickupAddress == "Manchester Airport, UK"){InitFare = 29};//ManA-Cast-£29.
    if(PickupTown == "Castleton" && DestinationAddress == "Manchester Airport, UK"){InitFare = 27};//ManA-Cast-£27.
    if(DestinationAddress == "Liverpool Airport, UK" && PickupAddress == "Manchester Airport, UK"){InitFare =50};//ManA-LivA-£50.
    if(DestinationAddress == "Leeds Bradford Airport, UK" && PickupAddress == "Manchester Airport, UK"){InitFare =50};//ManA-LeBaA-£50.
    if(DestinationAddress == "" && PickupAddress == ""){InitFare ="ERROR"};//error*/
    InitFare =CurrencyFormatted(InitFare);
    document.getElementById("initial-fare").value = InitFare;//replace quoted fare with new set fare for car.
    document.getElementById("input_18").value = InitFare;//replace quoted fare with new set fare for car.
    document.getElementById("QuotedFare").innerHTML = "£ " + InitFare;//dispaly fare for customer
    }
    Thanks Chris1990
    Last edited by chris1990; Nov 15th, 2011 at 10:44 AM.
    If your question is answered then mark your thread RESOLVED and give credit to whoever answered it.

    If you fail, try and try again, its the only way to success.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width