Give code Email Checking
Answers were Sorted based on User's Feedback
Answer / bharani kumar
var ree;
ree=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
if(ree.test(document.formname.txt_email.value)==false){
alert("Enter valid email id");
document.formname.txt_email.value = "";
document.formname.txt_email.focus();
return false;
}
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / rajender
function isEmail (s) {
if (isEmpty(s))
if (isEmail.arguments.length == 1) return defaultEmptyOK;
else return (isEmail.arguments[1] == true);
if (isWhitespace(s)) return false;
var i = 1;
var sLength = s.length;
while ((i < sLength) && (s.charAt(i) != "@")) {
i++
}
if ((i >= sLength) || (s.charAt(i) != "@")) return false;
else i += 2;
while ((i < sLength) && (s.charAt(i) != ".")) {
i++
}
if ((i >= sLength - 1) || (s.charAt(i) != ".")) return false;
else return true;
}
Is This Answer Correct ? | 1 Yes | 2 No |
How to accessing elements using javascript?
What is object cloning
What is the use of type of operator?
How much does a javascript developer make?
Explain the for-in loop?
What is isnan in javascript?
Can I learn javascript without html?
How do I activate javascript on my phone?
Can array in javascript be extended?
Are there any iphone Institutes which also train iphone automation testing in Hyderabad?
How use javascript html?
What is the function of delete operator?