Advertisement
Guest User

Untitled

a guest
Feb 19th, 2017
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. function controlla() {
  2. var email=(document.getElementsByName("emailutente")[0].value);
  3. var password=(document.getElementsByName("passwordutente")[0].value);
  4. var confermapassword=(document.getElementsByName("confermapassword")[0].value;
  5. var username=(document.getElementsByName("usernameutente")[0].value);
  6. var nome=(document.getElementsByName("nomeutente")[0].value);
  7. var cognome=(document.getElementsByName("cognomeutente")[0].value);
  8. var datadinascita=(document.getElementsByName("datadinascitautente")[0].value);
  9. var sesso=(document.getElementsByName("sessoutente")[0].value);
  10. var telefono=parseInt(document.getElementsByName("telefonoutente")[0].value);
  11. var codicefiscale=(document.getElementsByName("codicefiscaleutente")[0].value);
  12.  
  13. if ((email!=0) && (isNaN(email)==true) &&
  14. (password!=0) && (isNaN(password)==true) &&
  15. (confermapassword!=0) && (isNaN(confermapassword)==true) &&
  16. (username!=0) && (isNaN(username)==true) &&
  17. (nome!=0) && (isNaN(nome)==true) &&
  18. (cognome!=0) && (isNaN(cognome)==true) &&
  19. (datadinascita!=0) && (isNaN(datadinascita)==true) &&
  20. (sesso!=0) && (isNaN(sesso)==true) &&
  21. (telefono!=0) && (isNaN(telefono)==false) &&
  22. (codicefiscale!=0) && (isNaN(codicefiscale)==true) &&
  23. (password==confermapassword)) {
  24.  
  25. document.getElementById("inserimento").submit();}
  26. else if (password!=confermapassword) {
  27. alert("Le pass non sono uguali");}
  28. return false;
  29.  
  30. else { alert("Attenzione! Ci sono valori errati. Riprovare.");
  31. return false;
  32.  
  33. }
  34.  
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement