Please sombody tell me .. i hv an input box like this
<td >
<input type="text" name="emailid" id="emailid" onBlur="checkMail(this)" value="emailId" onFocus="this.value=''">
@domain.com</td>
And the checkmail function is like this
//function to check email address format
function checkMail(emailid) {
var mail = emailid.value;
var reg = new RegExp('^[a-z0-9]+([_|\.|-]{1}[a-z0-9]+)*@[a-z0-9]+([_|\.|-] {1}[a-z0-9]+)*[\.]{1}(com|ca|net|org|fr|in|us|gov|qc.ca|gouv.qc.ca)$', 'i');
if(!reg.test(mail) || mail == "")
{
alert("Please input a valid Email address");
document.edit_email.emailid.value='';
document.edit_email.emailid.focus()
return false;
}
else {
return true;
}
}
Now problem is as u can see .. i hav to check just "EMAIL ID" not the full "Email address".. i cud not be successful to edit the JS function.. plz help me !! :(