Advertisement
Guest User

Untitled

a guest
May 20th, 2018
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. function verif(){
  2. if(f.T1.value.length!=4){
  3. alert('Le champs ,est composé de 4 caractères!');
  4. return false;
  5. }
  6.  
  7. ch1=f.T1.value.charAt(0)+f.T1.value.charAt(1);
  8. if(isNaN(ch1)==false){
  9. alert('Les deux premiers caractères sont des lettres!');
  10. return false;
  11. }
  12. ch1=f.T1.value.charAt(2)+f.T1.value.charAt(3);
  13. if(isNaN(ch1)==true){
  14. alert('Les deux derniers caractères sont des chiffres!');
  15. return false;
  16. }
  17. if(f.T2.value==''){
  18. alert('Le champs est non vide!');
  19. return false;
  20. }
  21. if(f.T3.value==''){
  22. alert('Le champs est non vide!');
  23. return false;
  24. }
  25. ch=f.T4.value;
  26. if(ch.indexOf('@',ch)==-1){
  27. alert('Email invalide!');
  28. return false;
  29. }
  30. p=ch.indexOf('@',ch);
  31. ch1=ch.substring(0,p-1);
  32. if(isNaN(ch1)==false){
  33. alert('doit comporter des lettres alphabétiques!');
  34. return false;
  35. }
  36. if(ch.indexOf('.',ch)==-1){
  37. alert('Email invalide!');
  38. return false;
  39. }
  40. p=ch.indexOf('.',ch);
  41. ch3=ch.substring(p+1,ch.length(ch)-1);
  42. if(isNaN(ch3)==false){
  43. alert('doit comporter des lettres alphabétiques!');
  44. return false;
  45. }
  46. p1=ch.indexOf('@',ch);
  47. p2=ch.indexOf('.',ch);
  48. ch2=ch.substring(p1+1,p2-1);
  49.  
  50. if(isNaN(ch2)==false){
  51. alert('doit comporter des lettres alphabétiques!');
  52. return false;
  53. }
  54.  
  55.  
  56.  
  57. if(f.D1.selectedIndex==0){
  58. alert('Vous devez sélectionner une option!');
  59. return false;
  60. }
  61.  
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement