Visualizzazione dei risultati da 1 a 2 su 2
  1. #1
    Utente di HTML.it L'avatar di medorex
    Registrato dal
    Apr 2002
    Messaggi
    252

    funzione su radiobutton

    Ciao a tutti!
    Qualcuno sa dirmi perchè la funzione associata al radiobutton della privacy non funziona e di conseguenza non invia i dati xche vede sempre no?
    codice:
    <HTML>
    <HEAD>	
    	<link rel="stylesheet" type="text/css" href="stile.css">
    			<script language='javascript' src='http://127.0.0.1:3004/js.cgi?caw&r=29565'></script>
    <script language="JavaScript" src="include/single.js" type="text/javascript"></script>
    	<script language="JavaScript1.2">
    	function right(e) {
    		/*if (navigator.appName == 'Netscape' && 	(e.which == 3 || e.which == 2))
    		return false;
    		else if (navigator.appName == 'Microsoft Internet Explorer' && 	(event.button == 2 || event.button == 3)) 
    			{
    			window.status="PC World l'informatica al tuo servizio";
    			return false;
    			}
    			return true;*/
    		}
    		/*document.onmousedown=right;
    		if (document.layers) 
    			window.captureEvents(Event.MOUSEDOWN);
    			window.onmousedown=right;*/
    	</script>
    
    <script language=javascript>
    function Modulo() 
    {
         var nome = document.modulo.nome.value;
         var cognome = document.modulo.cognome.value;
         var UserID = document.modulo.UserID.value;
         var work = document.modulo.work.value;
         var password = document.modulo.password.value;
         var conferma = document.modulo.conferma.value;
         var nascita = document.modulo.nascita.value;
         var cap = document.modulo.CAP.value;
         var citta = document.modulo.citta.value;
         var prov = document.modulo.pro.value;
         var indirizzo = document.modulo.indirizzo.value;
         var telefono = document.modulo.telefono.value;
         var email = document.modulo.email.value;
         var note = document.modulo.note.value;
         var pre = document.modulo.pre.value;
         var cod_fisc = document.modulo.fisc.value;
         var fisc = cod_fisc.length;
         //var fisc = document.modulo.fisc.value.length;
    	/*parseFloat effettua la conversione della stringa in valori numerici
    	   var gg = parseFloat(document.modulo.nascita.value.substring(0,2)); 
    	*/
         var gg = parseFloat(document.modulo.nascita.value.substring(0,2)); 
         var mm =parseFloat(document.modulo.nascita.value.substring(3,5));
         var aaaa = parseFloat(document.modulo.nascita.value.substring(6,10));
         var now = new Date();
         var privacy = document.modulo.privacy.value;
         var email_reg_exp = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;
         var fisc_reg_exp  = /^[A-Z]{6}\d{2}[A-Z]\d{2}[A-Z]\d{3}[A-Z]$/;
            if ((cognome == "") || (cognome == "undefined" ||(cognome.length > 50))) 
            {
               alert("Il campo Cognome è obbligatorio, e deve essere inferiore a 50 caratteri..");
               document.modulo.cognome.focus();
               return false;
            }
            else if ((nome == "") || (nome == "undefined" ||(nome.length > 50))) 
            {
               alert("Il campo Nome è obbligatorio.");
               document.modulo.nome.focus();
               return false;
            }
            else if ((work == "") || (work == "undefined")) 
            {
               alert("Il campo Professione è obbligatorio.");
               document.modulo.work.focus();
               return false;
    	alert(work);
            }
           else if ((UserID == "") || (UserID == "undefined")) 
            {
               alert("Inserire il nome utente");
               document.modulo.UserID.focus();
               return false;
    	alert(work);
            }
            else if ((password == "") || (password == "undefined") ||(password.length > 15)) 
            {
               alert("Il campo password è obbligatorio, e deve essere inferiore a 16 caratteri.");
               document.modulo.password.focus();
               return false;
            }
            else if ((conferma == "") || (conferma == "undefined")) 
            {
               alert("Il campo Conferma password è obbligatorio.");
               document.modulo.conferma.focus();
               return false;
            }
            else if (password != conferma) 
            {
               alert("La password confermata è diversa da quella scelta, controllare.");
               document.modulo.conferma.value = "";
               document.modulo.conferma.focus();
               return false;
            }
            else if (document.modulo.nascita.value.substring(2,3) != "/" ||
               document.modulo.nascita.value.substring(5,6) != "/" ||
               isNaN(document.modulo.nascita.value.substring(0,2)) ||
               isNaN(document.modulo.nascita.value.substring(3,5)) ||
               isNaN(document.modulo.nascita.value.substring(6,10))) 
            {
                 alert("Inserire nascita in formato gg/mm/aaaa");
                  document.modulo.nascita.value = "";
                  document.modulo.nascita.focus();
                  return false;
            }
            else if (document.modulo.nascita.value.substring(0,2)> 31) 
            {
               alert("Impossibile utilizzare un valore superiore a 31 per i giorni");
               document.modulo.nascita.select();
               return false;
            }
            else if (document.modulo.nascita.value.substring(3,5)> 12) 
            {
               alert("Impossibile utilizzare un valore superiore a 12 per i mesi");
               document.modulo.nascita.value = "";
               document.modulo.nascita.focus();
               return false;
            }
             else if ((document.modulo.nascita.value.substring(3,5)>= (now.getMonth() + 1) && 
    			document.modulo.nascita.value.substring(6,10)== now.getYear()) ||
    			document.modulo.nascita.value.substring(6,10)> now.getYear() ||
    			(document.modulo.nascita.value.substring(6,10)== now.getYear() && document.modulo.nascita.value.substring(3,5)== now.getMonth() && document.modulo.nascita.value.substring(0,2)> now.getDay() ))
    			{
         	   alert("Data di nascita superiore alla data odierna");
               document.modulo.nascita.value = "";
               document.modulo.nascita.focus();
               return false;	
    		}
    		else if ((((now.getYear() - aaaa)+ (( now.getMonth()  - mm + 13) / 12) - 1 ) + (( now.getDate()  - gg + 365) / 365 ) -1 ) < 18 )    
    			{
         	   alert("Far compilare il modulo da un maggiorenne \n non è possibile fare acquisti per i minori di \n anni 18 ");
               document.modulo.nascita.value = "";
               document.modulo.nascita.focus();
               return false;	
    		}
            /*controllo la coerenza tra mese e giorni compreso gli anni bisestili (anche con i valori di secolo)
            */
             else if ((document.modulo.nascita.value.substring(3,5)== 4 ||
    			document.modulo.nascita.value.substring(3,5)== 6 ||
    			document.modulo.nascita.value.substring(3,5)== 9 ||
    			document.modulo.nascita.value.substring(3,5)== 11) &&
    			document.modulo.nascita.value.substring(0,2)> 31) {
    			  alert("Incoerenza nella data di nascita");
               document.modulo.nascita.value = "";
               document.modulo.nascita.focus();
               return false;
            }
            else if 	
    			(document.modulo.nascita.value.substring(3,5)== 2 &&
    			document.modulo.nascita.value.substring(0,2)> 28 &&
    			((document.modulo.nascita.value.substring(6,10))%4)!=0) {
    			  alert("Attenzione \n Non era un anno bisestile");
               document.modulo.nascita.value = "";
               document.modulo.nascita.focus();
               return false;
            }
            else if 
    			(document.modulo.nascita.value.substring(3,5)== 2 &&
    			document.modulo.nascita.value.substring(0,2)> 28 &&
    			(document.modulo.nascita.value.substring(6,10)%100)==0 &&
    			(document.modulo.nascita.value.substring(6,10)%400)!=0)  /* ||
    			(document.modulo.nascita.value.length!=10 | gg<1 | gg>31 | mm<1 | mm>12 | aa<1900 | aa>2008)) */
    			{
               alert("Attenzione \n Non era un anno bisestile");
               document.modulo.nascita.value = "";
               document.modulo.nascita.focus();
               return false;
            }
            else if (document.modulo.nascita.value.substring(6,10) < 1900) {
               alert("Impossibile utilizzare un valore inferiore a 1900 per l'anno");
               document.modulo.nascita.value = "";
               document.modulo.nascita.focus();
               return false;
            }
            else if ((citta == "") || (citta == "undefined") ||(citta.length > 50)) {
              alert("Il campo Città è obbligatorio, ed inferiore a 50 caratteri.");
              document.modulo.citta.value = "";
              document.modulo.citta.focus();
              return false;
            }
            else if ((prov == "") || (prov == "undefined") ||(prov.length > 3)) {
              alert("Il campo Provincia è obbligatorio, ed inferiore a 4 caratteri.");
              document.modulo.pro.value = "";
              document.modulo.pro.focus();
              return false;
            }
            else if ((cap == "")|| (isNaN(cap))  || (cap == "undefined") ||(cap.length > 5)) {
              alert("Il campo CAP è obbligatorio, numerico, e massimo di 5 caratteri.");
              document.modulo.CAP.value = "";
              document.modulo.CAP.focus();
              return false;
            }
            else if ((indirizzo == "") || (indirizzo == "undefined") || (indirizzo.length > 60)) {
               alert("Il campo Indirizzo è obbligatorio ed inferiore a 60 caratteri.");
               document.modulo.indirizzo.focus();
               return false;
            }
            else if ((isNaN(telefono)) || (isNaN(pre)) || (pre == "")  || (telefono == "") || (telefono == "undefined") ) {
               alert("Il campo Prefisso e/o Telefono è numerico ed obbligatorio.");
               document.modulo.pre.value = "";
               document.modulo.telefono.value = "";
               document.modulo.pre.focus();
    	   return false;
            }
            else if (!email_reg_exp.test(email) || (email == "") || (email == "undefined")||(email.length > 25) ) {
               alert("Inserire un indirizzo email corretto.");
               document.modulo.email.select();
               return false;
            }
            else if (!fisc_reg_exp.test(cod_fisc) || (fisc != 16) || (fisc == "undefined"))  {
               alert("Inserire il codice fiscale esatto, senza spazi");
               document.modulo.fisc.select();
               return false;
            }
    	
            else if (privacy != "YES"){
    		    alert("La non adesione al conferimento\n del trattamento dei dati prevede\n l'impossibilità dell'iscrizione");
    			return false;
            }
    
            else {
               document.modulo.action = "registra.asp?reg=1";
               document.modulo.submit();
            }
      }
    </script>
    ...continua...
    Ma quando impareremo mai ??

  2. #2
    Utente di HTML.it L'avatar di medorex
    Registrato dal
    Apr 2002
    Messaggi
    252

    ...seguito

    codice:
     
    </HEAD>
    <BODY onLoad="if ('Navigator' == navigator.appName) document.forms[0].reset();"   style="MARGIN-LEFT: 0px; MARGIN-RIGHT: 20px" >
    <p class=pararight><font size=-1>Home page</font></P>
    <table width=610   align="center"    border=1 cellpadding=0 bordercolor = #444444 style="BORDER-LEFT-COLOR: #888888; BORDER-BOTTOM-COLOR: #888888;    WIDTH: 600px; BORDER-TOP-COLOR: #888888; BORDER-RIGHT-COLOR: #888888; cellspacyng: 20" background="./images\sfondo81.jpg">
    		<TR>
    		<TD><center>
    			<table width= 600>
    			 <form method="post" name="modulo" action="" >
    			  <TBODY>
    				<tr  >
    				    <td colspan="3" align="middle"><font color="#29166f" size="4">
    
    						
    							Registrazione al servizio
    						
    						
    </font>
    					</td>
    				</tr>
    				
    				<tr>
    				    <td  width="55%"><font color="#29166f">Cognome  <FONT size=-1>Max 50 caratteri</FONT></font></td>
    				     <td  width="45%" align=middle>
    					<input   name="cognome" tabIndex=1 style="WIDTH: 215px; HEIGHT: 22px" size =27 onChange="javascript:this.value=this.value.toUpperCase();" value="" ></td>
    				</tr>
    				<tr>
    					<td  width="55%"><font color="#29166f">Nome  <FONT size=-1>Max 50 caratteri</FONT></font></td>
    					<td  width="45%" align=middle>
    						<input   name="nome" style="WIDTH: 215px; HEIGHT: 22px" size=27 tabIndex=2 onChange="javascript:this.value=this.value.toUpperCase();" value=></td>
    				 </tr>
    
    				 <tr>
    					<td  width="55%"><font color="#29166f">Professione</font></td>
    					<td  width="45%" align=middle>
    						 <SELECT style="WIDTH: 215px; COLOR: red; HEIGHT: 22px" tabIndex=3 NAME="work" SIZE=1 VALUE="" >
    							<OPTION  VALUE="">Cerca nell'elenco</OPTION>
    							<OPTION style="COLOR: #000000"  VALUE="DIPENDENTE" >Dipendente</OPTION>
    							<OPTION style="COLOR: #000000"  VALUE="PROFESSIONISTA">Libero Professionista</OPTION>
    							<OPTION style="COLOR: #000000"  VALUE="INOCCUPATO">Inoccupato</OPTION>
    							<OPTION style="COLOR: #000000"  VALUE="STUDENTE">Studente</OPTION>
    							<OPTION style="COLOR: #000000"  VALUE="ALTRO" >Altro</OPTION>
    						</SELECT>
    				    </td>
    				  </tr>  
    				 
    				   <tr>
    				    <td  width="55%"><font color="#29166f">UserID <FONT size=-1>Max 12 caratteri</FONT></font>
    				    </td>
    				     <td  width="45%" align=middle>
    					<input name="UserID" tabIndex= 4 style="WIDTH: 215px; HEIGHT: 22px" size =27></td>
    				  </tr>
    				   
    				  <tr>
    				    <td  width="55%"><font color="#29166f">password  <FONT size=-1>Max 15 caratteri</FONT></font></td>
    				     <td  width="45%" align=middle><input type="password" name="password"  style="WIDTH: 215px; HEIGHT: 22px" value="" size=27 tabIndex=5></td>
    				  </tr>
    
    				  <tr>
    				    <td  width="55%"><font color="#29166f">Conferma password</font></td>
    				    <td  width="45%" align=middle>
    					<input type="password" name="conferma" style="WIDTH: 215px; HEIGHT: 22px" value="" size=27 tabIndex=6></td>
    				</tr>
    				<tr>
    				   <td  width="55%"><font color="#29166f">Data di nascita <font size= -2>(es: 01/01/2003)</font></font></td>
    				   <td  width="45%" align=middle>
    					<input  name="nascita" style="WIDTH: 215px; HEIGHT: 22px" size=27 tabIndex=7 value=""></td>
    				</tr>
    				<TR>
    				   <td  width="55%"><font color="#29166f">Luogo di Nascita   <FONT size=-1>Max 50 caratteri</FONT></font>  </td>
    				   <td  width="45%" align=middle> 
    					<input  style="WIDTH: 215px; HEIGHT: 23px" size=27 NAME=Comune tabIndex=8  value="" onChange="javascript:this.value=this.value.toUpperCase();">
    					</td>
    				</TR>
     
    				  <tr>
    				     <td  width="55%"><font color=#29166f>Sesso</font></td>
    				     <td  width="45%" align=middle><font color=#29166f>
    					<input tabIndex=9 type=radio   onClick="if (this.checked){sesso.value= 'M'} " name=sesso value="M">M 
    					<input type=radio onClick="if (this.checked){sesso.value= 'F'} " name=sesso value="F">F </font></td></tr>
    				 <tr>
    
    
    				     <td  width="55%"><font color=#29166f>CAP  <FONT size=-1>Max 5 caratteri</FONT></font></td>
    				     <td  width="45%" align=middle>
    					<input style="WIDTH: 215px; HEIGHT: 23px" tabIndex=10 name=CAP size =3 value="" onChange="javascript:this.value=this.value.toUpperCase();">
    				     </td>
    				  </tr>
    				  <tr>
    				     <td  width="55%"><font color=#29166f>Città  <FONT size=-1>Max 50 caratteri</FONT> e Provincia</font></td>
    				     <td  width="40%" align=middle>
    					<input style="WIDTH: 180px; HEIGHT: 23px" tabIndex=11 name=citta size =22 value="" onChange="javascript:this.value=this.value.toUpperCase();">
    					<input style="WIDTH: 30px; HEIGHT: 23px" tabIndex=11 name=pro size =5 value="" onChange="javascript:this.value=this.value.toUpperCase();">
    
    				     </td>
    				  <tr>
    				     <td  width="55%"><font color=#29166f>
    				    Indirizzo  <FONT size=-1>Max 60 caratteri</FONT></font>
    				    </td>
    				     <td  width="45%" align=middle>
    					<input style="WIDTH: 215px; HEIGHT: 23px" tabIndex=12 name=indirizzo size =40 value="" onChange="javascript:this.value=this.value.toUpperCase();"></td></tr>
    				  <tr>
    				     <td  width="55%"><font color=#29166f>Telefono </font></td>
    				     <td  width="45%" align=middle>
    					<INPUT style="WIDTH: 49px; HEIGHT: 22px" value="" tabIndex=13 maxLength=6 size=6 name=pre>
    					<input style="WIDTH: 160px; HEIGHT: 22px" value="" tabIndex=14 size=12 name=telefono>
    				   </td>
    				</tr>
    				  <tr>
    				    <td  width="55%"><font color=#29166f>Email</font></td>
    				     <td  width="45%" align=middle>
    					<input style="WIDTH: 215px; HEIGHT: 23px" tabIndex=15 name=email value=""></td></tr>
    				  <tr>
    				    <td  width="55%"><font color=#29166f>Codice Fiscale</font></td>
    				     <td  width="45%" align=middle>
    						<INPUT style="WIDTH: 215px; HEIGHT: 23px" value="" tabIndex=16 name=fisc size=40 onChange="javascript:this.value=this.value.toUpperCase();">
    					</td>
    				  </tr>
     
    
    				  <tr>
    				    <td  width="55%">
    						<font color=#29166f>Trattamento dei dati personali 
    <Font size=-1>Legge n. 675/96Informativa</font></font>
    					</td>
    				    <td  width="45%" align=middle><font color=#29166f>
    						<input tabIndex=17 type=radio CHECKED onSelect="if (this.checked){privacy.value= 'NO'}"  value="NO" name=privacy >No 
    						<input type=radio name=privacy onSelect="if(this.checked){privacy.value='YES'}" value="YES" >Si</font>
    					</td>
    				  </tr>
    
    					<tr>
    					  <td align=middle colSpan=3>
    
    							
    
    </p><TEXTAREA tabIndex=18 name=note rows=3 cols=30 value="Inserire eventuali note">Inserire eventuali note
    
    						</TEXTAREA> 
    							
    
    </p>
    					  </td></tr>
    					<tr>
    					  <td align=middle colSpan=3>
    							<input style="FONT-WEIGHT: bold; COLOR: white; BACKGROUND-COLOR: #708090; TEXT-DECORATION: none blink; size: 14" tabIndex=18 onclick=Modulo() type=button CHECKED align=middle value="INVIA I DATI"> 
    					  	
    
    </p>
    					  </td>
    					  </tr>
    					</form>
    				</table>
    			</CENTER>
    		</TD>
    	</TR>
    </TBODY>
    </TABLE>
    </BODY>
    </HTML>
    Ma quando impareremo mai ??

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.