Sample email validation by showing images

Saratvaddilli
Posted by Saratvaddilli under JavaScript category on | Points: 40 | Views : 1051
<script language="JavaScript" type="text/javascript">  
function emailCheck(email){
var reg =/^[a-z_0-9]+@+[a-z_0-9]+(.com|.edu|.net|.mil|.co.uk)$/
if (reg.test(email)) {
document.getElementById("check").innerHTML = "<img src='images/check.gif'>"
}else{
document.getElementById("check").innerHTML = "<img src='images/uncheck.gif'>"
}
}
</script>
<input type="text" id="email" onkeyup="emailCheck(this.value)">
<span id="check">
<script>
emailCheck()
</script>
</span>

Comments or Responses

Login to post response