Email address fields validation
through javascript
function validate_email(fieldid, msgid,
error_icon_star) {
var field = document.getElementById(fieldid);
if (check_blank(fieldid, msgid)) {
apos = value.indexOf("@");
dotpos = value.lastIndexOf(".");
if (apos < 1 || dotpos - apos < 2) {
document.getElementById(msgid).innerHTML = 'please
enter correct email';
//document.getElementById(error_icon_star).innerHTML='<img
src="WebResource.gif" height="15px" style="width:15px;"/>';
return false;
}
else {
document.getElementById(msgid).innerHTML = " ";
//document.getElementById(error_icon_star).innerHTML='<b
style="color:Red">*</b>';
return true;
}
}
return false;
}
}
Reactions: |
No comments:
Post a Comment