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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
| <script language="javascript" type="text/javascript">
<!--
function analyse(str) {
var at="@"
var dot="."
var lat=str.indexOf(at)
var lstr=str.length
var ldot=str.indexOf(dot)
if (str.indexOf(at)==-1){
alert("Votre adresse de courriel est invalide !")
return false
}
if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
alert("Votre adresse de courriel est invalide !")
return false
}
if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
alert("Votre adresse de courriel est invalide !")
return false
}
if (str.indexOf(at,(lat+1))!=-1){
alert("Votre adresse de courriel est invalide !")
return false
}
if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
alert("Votre adresse de courriel est invalide !")
return false
}
if (str.indexOf(dot,(lat+2))==-1){
alert("Votre adresse de courriel est invalide !")
return false
}
if (str.indexOf(" ")!=-1){
alert("Votre adresse de courriel est invalide !")
return false
}
return true
}
function Valider(){
if(document.form1.nom.value == "")
{
alert ('Veuillez entrer votre nom !');
document.form1.nom.focus();
return false;
}
var ad_courriel=document.form1.courriel
if ((ad_courriel.value==null)||(ad_courriel.value=="")){
alert("Entrez votre adresse de courriel, s'il vous plaît !")
ad_courriel.focus()
return false
}
if (analyse(ad_courriel.value)==false){
ad_courriel.value=""
ad_courriel.focus()
return false
}
return true
}
-->
</script> |
Partager