comment valider un champ d'un email
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<head>
<title>Document sans titre</title>
<script language="JavaScript">
<!--
 
	function isverifEm(p){
	var em=/^[a-z 0-9 -_.]+@[a-z 0-9 -_.]+.[a-z] {2,3}$/;
	return p.match(em);
	}
	function verifEm(){
	ver=document.myform.email.value;
	if(!isverifEm(ver))
document.getElementById("errr").style.display = 'block';
	}
 //-->
</script>
</head>
<body>
 
              <form method="post" action="#" name="myform" >
E-mail:<input name="Loginop" type="text"  maxlength="22" onBlur="verifEm();">
<p id="errr" style="display:none ;color:red"> Erreur de format </p>
 
              </form>
</body>