Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: "");" is not valid at the start of a code block. Only identifiers, keywords, comments, "(" and "{" are valid.
Source Error:
Line 16: var idx1 = me.value.indexOf("@");
Line 17: if(idx1>-1){
Line 18: var splitStr = me.value.split("@");
Line 19: var sub = splitStr[1].split(".");
Line 20: if(domains.indexOf(sub[0])>-1){
Using this code as-is (on asp. mvc view):
<script>
var domains = ["google","msn","yahoo"]; //update ur domains here
function validateDomain(me){
var idx1 = me.value.indexOf("@");
if(idx1>-1){
var splitStr = me.value.split("@");
var sub = splitStr[1].split(".");
if(domains.indexOf(sub[0])>-1){
me.value="";
alert("invalid email");
}
}
}
</script>
Member
84 Points
1516 Posts
Re: Any javascript validation to restrict specific email domain names from entering?
Nov 29, 2016 02:48 PM|jeffcarter|LINK
I am getting error:
Using this code as-is (on asp. mvc view):