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 |
What are the data types available in javascript? Explain
What does the isNaN() function?
What do mean by NULL in Javascript?
How are object properties assigned?
TypeError: document.getelementbyid(...) is null?
What are the distinct types of error name values?
Can an anonymous function be assigned to a variable?
What do you mean by enumeration?
What is a string in javascript?
Write a JavaScript function which can take any number of strings as arguments and outputs them as a single concatenated string.
How do you trim in javascript?
What is Unobtrusive JavaScript & Why it's Important?