- التأكد من أن الحق المدخل يحتوي على بريد الكتورني صحيح
تفضل أخي..
كود:
//Checking the Email Address
if (document.form1.email.value=="") {
alert("Please enter your email address")
document.form1.email.focus()
return false
}
//Checking the email Address (if it doen't contain @ symbol)
var At = document.form1.email.value.indexOf("@",0)
if (At < 1 ) {
alert ("Your email address has to have an @ symbol")
document.form1.email.focus()
return false
}
// Checking the email Address (if it contains unwanted characters and any space)
var email = document.form1.email.value;
var Char = "; ,/:)(*%#$!=+^\?"
for (y=0; y<Char.length; y++){
q = Char.charAt(y);
if (email.indexOf(q,0) > -1) {
alert("Please remove any unwanted characters (; ,/:)(*%#$!=+^\?) of your email address")
document.form1.email.focus()
return false
}
}
//CHecking the email Address (if it has @ or . at the end)
var emaill=email.length;
if ((email.charAt(emaill - 1)==".") || (email.charAt(emaill -1))=="@"){
alert("Your email address can not end with an (@) symbol or a (.)")
document.form1.email.focus()
return false
}
أتوقع إنك تعرف كيف تركبه على الفورم اللي عندك..
بالتوفيق..