susie123
10-17-2007, 04:11 PM
Hi. I have written the following text which works totally except for one thing. If the email input box has been typed into, after the message "Please enter a valid email address"l, I want that text written in error to be highlighted so the client doesn´t have to delete it and can just type straight back in with a corrected email address.
function email_onblur()
{
var email = document.form1.email.value;
var atSign = email.indexOf("@")
if ((atSign == -1) == true)
{
alert("Please enter a valid email address.");
myForm.email.focus();
myForm.email.select();
}
}
I feel it is the text highlighted in green above that is not working, everything else is ok. Any ideas?
Many thanks.
function email_onblur()
{
var email = document.form1.email.value;
var atSign = email.indexOf("@")
if ((atSign == -1) == true)
{
alert("Please enter a valid email address.");
myForm.email.focus();
myForm.email.select();
}
}
I feel it is the text highlighted in green above that is not working, everything else is ok. Any ideas?
Many thanks.