Sir, I am using these codes.
<script type="text/javascript" src="jquery-1.7.1.min.js"></script>
<script type="text/javascript">
function checkEmail()
{
var email = document.getElementById(xemail);
alert(email);
var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
if (!filter.test(email.value))
{
alert('Please provide a valid email address');
email.focus;
return false;
}
}
</script>
<tr>
<td width="40"><label>Email</label></td>
<td width="40">
<input type="text" name="email" id="xemail" value="<?php echo $myemail; ?>" onblur="checkEmail()">
</td>
</tr>
It always display this result:
[IMG]http://i43.tinypic.com/2e3911i.jpg[/IMG]
Textbox contains value but it says: Null
What I am doing wrong?