<html>
<head>
<meta charset=utf-8 content="width=device-width, initial-scale=1.0"/>
<title>form12</title>
<link rel=stylesheet href=iscrizione2.css type=text/css>
<script>
function verificaNome(){
var n=document.getElementById("nome").value;
var num= /^([0-9])+$/ ;
if ((n=="") || (n=="undefinited")){
document.getElementById("nome").style.background="red";
document.getElementById("errore").innerHTML="il nome non può essere nullo";
document.getElementById("errore").style.color="red";
return false;
}
var ris=num.test(n);
for (var i=0;i<n.length;i++){
ris=num.test(n.charAt(i))
if (ris){
document.getElementById("nome").style.background="red";
document.getElementById("nome").style.color="white";
document.getElementById("errore").innerHTML="il nome non può contenere numeri";
document.getElementById("errore").style.color="red";
return false;
}
}
if (n.length<3){
document.getElementById("errore").innerHTML="red";
document.getElementById("nome").style.background="red";
document.getElementById("errore").innerHTML="il nome deve essere di almeno 3 caratteri";
document.getElementById("errore").color="white";
return false;
}else
{
document.getElementById("nome").style.background="green";
document.getElementById("nome").style.color="white";
return true;
}
}
</script>
</head>
<body>
<form id=anagrafica>
<fieldset>
<legend> CHI SEI? </legend>
<p>I campi (*) sono obbligatori</p>
<ol>
<li>
<label>Nome*</label>
<input type=text id="nome" maxlength="15" placeholder=" Nome.." onblur="verificaNome()" required/>
<p id="errore1" /P>
</li>
<li>
<label>Cognome*</label>
<input type=text id="nome" maxlength="15" placeholder=" Cognome.." onblur="verificaNome()" required/>
<p id=<"errore1"/p>
</li>
<li>
<label>Sesso</label>
<input type="radio" name="sex" value="Male">Uomo
<input type="radio" name="sex" value="Female">Donna</br>
</li>
<li>
<label>Data di nascita</label>
<input type=date id="data"onchange="generaUsername()" >
</li>
</ol>
</fieldset >
<fieldset>
<legend>Contatti</legend>
<ol>
<li>
<label>Cellulare</label>
<input type=text id="cellulare" maxlength="10" placeholder=" 3xxxxxxxxx" onblur="verificaNumero()" >
<p id="errore3" /P>
</li>
<li>
<label>E-mail*</label>
<input type=mail name="email" maxlength="30" placeholder=" [email protected]" onblur="verificaEmail()" required>
</li>
</ol>
</fieldset>
<fieldset>
<legend>Sicurezza</legend>
<ol>
<li>
<label>Username*</label>
<input type="text" id="username" placeholder=" Username.." onblur="generaUsername()" required/>
<p id="errore2" /p>
</li>
</ol>
</fieldset>
<fieldset>
<legend>Campi password</legend>
<ol>
<li>
<label>Password*</label>
<input type="password" id="password" maxlength="10" placeholder="*********" required>
<em>minimo 6 caratteri</em>
</li>
<li>
<label>Ripeti Password*</label>
<input type="password" id="password2" maxlength="10" onblur="sicurezzaPassword()" placeholder="*********" required>
<p id="errore" /p>
</li>
<li>
<label>Sicurezza Password</label>
<input type="text" id="sicpasw"value="sicurezza password" disabled="disabled"/>
</li>
</ol>
</fieldset>
<fieldset>
<legend>Scegli Avatar</legend>
<ol id=avatar>
<li>
<img class="dimensione"src="manga-avatar-1.jpg" alt="immagine" width="60" height="60">
<div><input type="radio" name="sex" value="male">ted</div>
</li>
<li>
<img src="Natsu-2.jpg" alt="immagine" width="60" height="60">
<div><input type="radio" name="sex" value="male">mike</div>
</li>
<li>
<img src="mk.jpg" alt="immagine" width="60" height="60">
<div><input type="radio" name="sex" value="female">sveva</div>
</li>
<li>
<img src="82.jpg" alt="immagine" width="60" height="60">
<div><input type="radio" name="sex" value="male">john</div>
</li>
<li>
<img src="face_your_manga.jpg" alt="immagine" width="60" height="60">
<div><input type="radio" name="sex" value="female">robin</div>
</li>
<li>
<img src="Imagineer.png" alt="immagine" width="60" height="60"></br>
<div><input type="radio" name="sex" value="female">martha</div>
</li>
</ol>
</fieldset>
<fieldset>
<button type=submit >ISCRIVITI</button>
</fieldset>
</form>
</body>
</html>