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 is a closure in javascript?
What is the difference between the substr() and substring() functions in javascript?
Which built-in method returns the length of the string?
java pgm for compare two vesion and print the greatest version on the console. e.g: like 1.4.2 and 1.5.2 biggest is 1.5.2 1.2.5 and 1.2.8 biggest is 1.2.8
discuss scoping in javascript?
Explain “use strict” ?
How can you declare a class in javascript?
How javascript variables work?
List some features of javascript.
What is javascript bom?
How can javascript be used to personalize or tailor a web site to fit individual users?
Which javascript is best?