Visualizzazione dei risultati da 1 a 3 su 3
  1. #1

    Select OnChange Compatibilità

    Salve sono alle prese con un problema di compatibilità .
    ho una pagina asp che genera il seguente codice :
    codice:
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    
    
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    
    
    <script language="JavaScript">
    function Controlla(ff){
    var msg='';
       if(ff.descrizione.value=='')msg+='Inserire Descrizione\n';
       if(ff.qty.value=='')msg+='Inserire quantit?\n';
       if(ff.UnitValue.value=='')msg+='Inserire Valore Unitario\n';
       if(msg!=''){
         alert('ATTENZIONE!\n'+msg);
         return false
       }
       else return true
    }
    
    function cerca(id,JOB,tipo,sorgente){
    var chiavecod='';
    var chiavedes='';
        chiavedes = document.dettaglior.descrizione.value;
    	if(document.dettaglior.codart.value==''){
    	  chiavecod = '';
    	}   
        else {
    	  chiavecod = document.dettaglior.codart.value;
        }
         location.href = "commessa_ricavi_detail.asp?azione=c&id=" + id + "&JOB=" + JOB + "&tipo=" + tipo + "&chiavecod=" + chiavecod + "&chiavedes=" + chiavedes + "&sorg=" + sorgente;
    }
    
    function cercacod(id,JOB,tipo,sorgente){
    var chiavecod='';
    var chiavedes='';
        chiavedes = document.dettaglior.descrizione.value;
        if(document.dettaglior.codart.value==''){
    	  chiavecod = '';
    	}   
        else {
    	  chiavecod = document.dettaglior.codart.value;
        }
         location.href = "commessa_ricavi_detail.asp?azione=c&id=" + id + "&JOB=" + JOB + "&tipo=" + tipo + "&chiavecod=" + chiavecod + "&chiavedes=" + chiavedes + "&sorg=" + sorgente;
    }
    
    </script>
    <script type="text/javascript">
    
    
    function seleziona(indice) {
     document.getElementById('codart').value = '';
     document.getElementById('um').value = '';
     document.getElementById('qty').value = '';
     document.getElementById('UnitValue').value = '';
     document.getElementById('TaxCode').value = '';
     document.getElementById('ISGOOD').value = '';
     document.getElementById('Perc').value = '';
     document.getElementById('MA_ChartOfAccounts').value = '';
     document.getElementById('DescriLang').value = '';
    
     //------ Indice 0 -> Esco
     if (indice == 0) {
      return;
     }
     a = "val"+indice+"codart";
     b = "val"+indice+"um";
     c = "val"+indice+"UnitValue";
     d = "val"+indice+"TaxCode";
     e = "val"+indice+"ISGOOD";
     f = "val"+indice+"Perc";
     g = "val"+indice+"MA_ChartOfAccounts";
     h = "val"+indice+"DescriLang";
    
     //------ Assegno i valori
     document.getElementById('codart').value = document.getElementById(a).value;
     document.getElementById('um').value = document.getElementById(b).value;
     document.getElementById('qty').value = '1';
     document.getElementById('UnitValue').value = document.getElementById(c).value;
     document.getElementById('TaxCode').value = document.getElementById(d).value;
     document.getElementById('ISGOOD').value = document.getElementById(e).value;
     document.getElementById('Perc').value = document.getElementById(f).value;
     document.getElementById('MA_ChartOfAccounts').value = document.getElementById(g).value;
     document.getElementById('DescriLang').value = document.getElementById(h).value;
    
    } // 
    //-->
    </script>
    
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>dettaglio Documento</title>
    <link href="css/dataentry.css" rel="stylesheet" type="text/css">
    </head>
    <body>
    
    	<form method="post" action="commessa_ricavi_detail.asp?JOB=111449&id=172&line=0&tipo=fattura&azione=a&sorg=ordine" name="dettaglior" onSubmit="return Controlla(this)" >
    
    	<table width="95%" border="0" cellspacing="1">
    
        <tr> 
        	<td width="7%" bgcolor="#FFCC66" class="testolight">codice</td>
    	    <td width="40%" bgcolor="#FFCC66" class="testolight">descrizione</td>
    <!--	    <td width="3%" bgcolor="#FFCC66" class="testolight">U.M.</td>
    -->	    <td width="5%" bgcolor="#FFCC66" class="testolight"><div align="right">quantit&agrave;</div></td>
    	    <td width="7%" bgcolor="#FFCC66" class="testolight"><div align="right">Val. Unitario</div></td>
    	    <td width="10%" bgcolor="#FFCC66" class="testolight"><div align="right">TOT Imponibile</div></td>
    	    <td width="9%" bgcolor="#FFCC66" class="testolight"><div align="right">Totale</div></td>
      	    <td width="5%" bgcolor="#FFCC66" class="testolight"><div align="right">Pratica</div></td>
    	    <td width="5%" bgcolor="#FFCC66" class="testolight"><div align="right"></div></td>
    	    <td width="5%" bgcolor="#FFCC66" class="testolight"><div align="right"></div></td>
      </tr>
          
          
      <tr>
         <td bgcolor="#FFFFFF"><input name="codart"  type="hidden"  ><td bgcolor="#FFFFFF"><select name="descrizione" class="pulldown"onChange="javascript:seleziona(this.selectedIndex)">
    <option value="">...Seleziona</option>
    <option value="Anticipazioni per Tasse deposito opposizione in oggetto:">3028 Anticipazioni per Tasse deposito opposizione in oggetto:</option>
    <option value="Anticipazioni per tasse governative, diritti di segreteria e bolli;">3024 Anticipazioni per tasse governative, diritti di segreteria e bolli;</option>
    </select></td>
    <input type="hidden" id="val1codart" value="3028">
    <input type="hidden" id="val1um" value="">
    <input type="hidden" id="val1UnitValue" value="">
    <input type="hidden" id="val1TaxCode" value="21">
    <input type="hidden" id="val1Perc" value="21">
    <input type="hidden" id="val1ISGOOD" value="0">
    <input type="hidden" id="val1MA_ChartOfAccounts" value="07014370">
    <input type="hidden" id="val1DescriLang" value="">
    <input type="hidden" id="val2codart" value="3024">
    <input type="hidden" id="val2um" value="">
    <input type="hidden" id="val2UnitValue" value="">
    <input type="hidden" id="val2TaxCode" value="ES15">
    <input type="hidden" id="val2Perc" value="0">
    <input type="hidden" id="val2ISGOOD" value="0">
    <input type="hidden" id="val2MA_ChartOfAccounts" value="01074040">
    <input type="hidden" id="val2DescriLang" value=""><td valign="bottom"  bgcolor="#FFFFFF"><div align="right">
        		<input name="qty" type="text" class="input" value="1" size="10" maxlength="10">
          </div></td>
        	<td valign="bottom" bgcolor="#FFFFFF"><div align="right">
    		    <input name="UnitValue" type="text" class="input" value="0" size="10" maxlength="10">
        		<input name="um" type="hidden" class="input" value="" size="5" maxlength="10">      
    		    <input name="TaxCode" type="hidden" value="21">
    		    <input name="ISGOOD" type="hidden" value="0">
    		    <input name="Perc" type="hidden" value="21">
    		    <input name="MA_ChartOfAccounts" type="hidden" value="5010102005">
    		    <input name="DescriLang" type="hidden" value="">
       	  </div></td>
    	 </td>
       <tr>
       <td bgcolor="#D1E0EF" ><div align="right"><input name="azione" type="submit" class="bottone" id="inserisci" value="Inserisci"></div></td>
    <td bgcolor="#D1E0EF" ><div align="right"><input name="azione" type="submit" class="bottone" id="annulla" value="annulla"></div></td>
    <td bgcolor="#D1E0EF"></td>
      </tr>
       </table>
       </form>
    </body>
    </html>
    Il codice, così comìè funziona perfettamente in EXPLORER ovvero, effettuando il change della selct tutti i valori "hidden" vengono recyupertai dallo script seleziona e passati regolarmente alla funzione di inserimento.
    Usando chrome o firefox invece tutti valori vegono passati tranne la variabile CODART che rimane nulla.
    Non riesco a stanare il problema, qualcuno mi sa dire in cosa differiscono i browser per una funzione in fondo così semplice ? sto percaso usando una parola riservata ?
    bohhhhhhhhhhhh
    Grazie a chiunque possa aiutarmi fin da ora !

  2. #2
    Amministratore L'avatar di Vincent.Zeno
    Registrato dal
    May 2003
    residenza
    Emilia-Romagna (tortellini und cappelletti land!)
    Messaggi
    20,783
    ricorda che sei tenuto, come tutti, ad utilizzare il tag [CODE][/CODE] per postare codice sul forum. grazie

    sposto in js

  3. #3
    Moderatore di JavaScript L'avatar di br1
    Registrato dal
    Jul 1999
    Messaggi
    19,998
    Non c'e' nessun oggetto con id="codart" ce ne sta uno che pero' ha name="codart"... questo e' sufficiente per IE ma non per gli altri.
    Il guaio per i poveri computers e' che sono gli uomini a comandarli.

    Attenzione ai titoli delle discussioni: (ri)leggete il regolamento
    Consultate la discussione in rilievo: script / discussioni utili
    Usate la funzione di Ricerca del Forum

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.