Visualizzazione dei risultati da 1 a 7 su 7

Visualizzazione discussione

  1. #1

    [jQuery] Ottimizzare controlli

    Buon giorno.
    Ho una funzione che gestisce l'invio dei dati ad una seconda pagina che esegue l'INSERT.
    Soltanto che vorrei ottimizzarla ma non so come fare.
    Tutte quelle if, per esempio non posso essere ottimizzate?
    codice:
    function subInUppIstr(tip,id_istr,id_dett){
                var morDal        = $("#morDal").val();
                var morAl        = $("#morAl").val();
                var salMor        = $("#salMor").val();
                var intDal        = $("#intDal").val();
                var intAl        = $("#intAl").val();
                var salInt        = $("#salInt").val();
                var impCre        = $("#impCre").val();
                var impDeb        = $("#impDeb").val();
                var impRim        = $("#impRim").val();
                var saldTot        = $("#saldTot").val();
                var morUtePrec    = $("#morUtePrec").val();
                var ImpCont        = $("#ImpCont").val();
                var numRat        = $("#numRat").val();
                if(morDal==undefined){
                    morDal = '';
                }
                if(morAl==undefined){
                    morAl = '';
                }
                if(salMor==undefined){
                    salMor = '';
                }
                if(intDal==undefined){
                    intDal = '';
                }
                if(intAl==undefined){
                    intAl = '';
                }
                if(salInt==undefined){
                    salInt = '';
                }
                if(impCre==undefined){
                    impCre = '';
                }
                if(impDeb==undefined){
                    impDeb = '';
                }
                if(impRim==undefined){
                    impRim = '';
                }
                if(saldTot==undefined){
                    saldTot = '';
                }
                if(morUtePrec==undefined){
                    morUtePrec = '';
                }
                if(ImpCont==undefined){
                    ImpCont = '';
                }
                if(numRat==undefined){
                    numRat = '';
                }
               
                          if(confirm("Aggiornare?")){/*ecc ecc*/}
    }
    Mi aiutate per favore?
    Ultima modifica di ANTAGONIA; 27-03-2015 a 10:13

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 © 2025 vBulletin Solutions, Inc. All rights reserved.