Visualizzazione dei risultati da 1 a 3 su 3
  1. #1
    Utente di HTML.it L'avatar di wegawhite
    Registrato dal
    Aug 2004
    Messaggi
    1,400

    Controllo campi non funziona

    Come mai questo controllo non funziona???:
    codice:
    <script language="JavaScript"> 
    <!-- 
    function submitIt(theform) { 
     
    if (theform.Nome.value == "") { 
    alert("Manca il nome..."); 
    theform.Nome.focus(); 
    return false; 
    } 
    if (theform.Cognome.value == "") { 
    alert("Manca il cognome..."); 
    theform.Cognome.focus(); 
    return false; 
    } 
    if (theform.Citta.value == "") { 
    alert("Manca la Città..."); 
    theform.Citta.focus(); 
    return false; 
    }
    if (theform.Stato.value == "") { 
    alert("Manca lo Stato..."); 
    theform.Stato.focus(); 
    return false; 
    } 
     
    re = new RegExp("^[!#$&'*+/-9=?A-Z^-~-]+(\\.[!#$&'*+/-9=?A-Z^-~-]+)*@[!#$&'*+/-9=?A-Z^-~-]+(\\.[!#$&'*+/-9=?A-Z^-~-]+)+$", "i");
     
      if (!theform.Email.value.match(re))
        {
          alert("L'email non è corretto...");
          theform.Email.focus();
          theform.Email.select();
          return(false);
        }
    
    // Abilita l'invio del FORM
      return(true);
    } 
    --> 
        </script>  
    
    <form action="<%=PostURL%>" method="POST" ENCTYPE="multipart/form-data" onsubmit="return (submitIt);">

  2. #2
    Utente di HTML.it L'avatar di wegawhite
    Registrato dal
    Aug 2004
    Messaggi
    1,400
    Cos'è che non va dove sbaglio???
    codice:
    <script><!--
    
    function validate(theform) {
    
    if (theform.File1.value == "") { 
    alert("Non è stato selezionato il file excel."); 
    theform.File1.focus(); 
    return false; 
    } 
    
    if (theform.Title.value == "") { 
    alert("Non sono stati inseriti Nome e Cognome."); 
    theform.Title.focus(); 
    return false; 
    } 
    
    re = new RegExp("^[!#$&'*+/-9=?A-Z^-~-]+(\\.[!#$&'*+/-9=?A-Z^-~-]+)*@[!#$&'*+/-9=?A-Z^-~-]+(\\.[!#$&'*+/-9=?A-Z^-~-]+)+$", "i");
     
      if (!theform.Email.value.match(re))
        {
          alert("L'indirizzo email inserito non è corretto.");
          theform.Email.focus();
          theform.Email.select();
          return(false);
        }
        
        if (theform.Description.value == "") { 
    alert("Non è stata inserita la descrizione del file."); 
    theform.Description.focus(); 
    return false; 
    }
    {
    ok = false;	
    } else {
    			ok = true;
    	}
    	if (ok)  {	
    
    ProgressBar()
    		return true
    	}
    	end if
    	
    	// Abilita l'invio del FORM
      return(true);
      
    }
    
    // -->
    
     </script>

  3. #3
    Utente di HTML.it L'avatar di wegawhite
    Registrato dal
    Aug 2004
    Messaggi
    1,400
    trovato e risolto!

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.