Visualizzazione dei risultati da 1 a 3 su 3
  1. #1
    ra.denis
    Guest

    [js] aiuto piccola modifica ad uno script

    ciao a tutti...

    ho bisogno di una piccola modifica ad uno script. lo script crea un url per un form, avremmo ora bisogno che questo url si apra in una nuova finestra.

    sfortunatamente mi serve entro domani e il programmatore esterno non riesco a sentirlo prima di lunedi.

    potete aiutarmi per cortesia?

    questo lo script:

    var strReferrerId = "CHEAPCHF";
    var intLangID = 1;
    var default_pickUp = new Date();
    default_pickUp.setDate(default_pickUp.getDate() + 4);
    var default_dropOff = new Date(default_pickUp);
    default_dropOff.setDate(default_dropOff.getDate() + 7);

    var aryMonthNames = ["January","February","March","April","May","Ju ne", "July", "August", "September", "October", "November", "December"];

    function icauto_submit()
    {
    if (icauto_validForm())
    {
    the_url = "http://www.company.com/miniQuote.asp?";
    the_url = the_url + "Referrer=";
    the_url = the_url + strReferrerId;
    the_url = the_url + "&LangID=" + intLangID;
    the_url = the_url + "&ColDay=";
    the_url = the_url + document.rental_car.cboPickUpDay.value;
    the_url = the_url + "&ColMonth=";
    the_url = the_url + document.rental_car.cboPickUpMonth.value;
    the_url = the_url + "&ColYear=";
    the_url = the_url + document.rental_car.cboPickUpYear.value;
    the_url = the_url + "&RtnDay=";
    the_url = the_url + document.rental_car.cboDropOffDay.value;
    the_url = the_url + "&RtnMonth=";
    the_url = the_url + document.rental_car.cboDropOffMonth.value;
    the_url = the_url + "&RtnYear=";
    the_url = the_url + document.rental_car.cboDropOffYear.value;
    the_url = the_url + "&Location=";
    the_url = the_url + document.rental_car.txtLocation.value;
    the_url = the_url + "&Cat=";
    the_url = the_url + document.rental_car.cboVehCat.value;
    the_url = the_url + "&RtnTime=";
    the_url = the_url + document.rental_car.cboDropOffTime.value;
    the_url = the_url + "&ColTime=";
    the_url = the_url + document.rental_car.cboPickupTime.value;
    the_url = the_url + "&Express=0";

    window.location = the_url;
    }
    }

    function icauto_validForm()
    {
    var dToday = new Date();
    var dayConst = 24 * 60 * 60 * 1000;

    var pYY = parseInt(document.rental_car.cboPickUpYear.value);
    var pMM = parseInt(document.rental_car.cboPickUpMonth.value) ;
    var pDD = parseInt(document.rental_car.cboPickUpDay.value);

    var dYY = parseInt(document.rental_car.cboDropOffYear.value) ;
    var dMM = parseInt(document.rental_car.cboDropOffMonth.value );
    var dDD = parseInt(document.rental_car.cboDropOffDay.value);

    var fromDate = new Date(pYY, pMM, pDD);
    var toDate = new Date(dYY, dMM, dDD);

    if (fromDate.getMonth() != pMM) {
    alert('Invalid Pick-up Date');
    return false;
    }


    if (toDate.getMonth() != dMM) {
    alert('Invalid Drop-off Date');
    return false;
    }


    if (fromDate > toDate)
    {
    alert("Sorry, you can't drop off your car before picking it up!");
    return false;
    }

    else if (fromDate < dToday)
    {
    alert("Sorry, the booking dates you entered are in the past!");
    return false;
    }

    else if (fromDate.getDate() == toDate.getDate() &&
    fromDate.getMonth() == toDate.getMonth() &&
    fromDate.getYear() == toDate.getYear())
    {
    alert('Collection and Return dates cannot be the same!');
    return false;
    }

    else if (((toDate - fromDate) / dayConst) > 60)
    {
    alert('Sorry, maximum car hire is 60 days!');
    return false;
    }

    else if (document.rental_car.txtLocation.value=="")
    {
    alert("Please choose a location!");
    document.rental_car.txtLocation.focus();
    return false;
    }

    else
    {
    document.rental_car.strFromDate.value=fromDate.toS tring();
    document.rental_car.strToDate.value=toDate.toStrin g();
    return true;
    }
    }

  2. #2
    Reale_Augello
    Guest

    Prova...

    ... a cambiare window.location = the_url; in:

    codice:
    window.open(the_url,'','width=500,height=500');
    Fammi sapere !

  3. #3
    ra.denis
    Guest
    Reale_Augello colpisce ancora! TNX!

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.