I am new to developing sites, I have created a form with a persons contact details.
In the email text field I would like to only allow email addresses with the character @, if the '@' character is not present, then an error message will be displayed.
Html code for email entry is:
<td class="content"><input name="txtEmail" type="text" class="box" id="txtEmail" size="60" maxlength="100" /></td>
Javascript to ensure that the field is entered is:
function checkShippingAndPaymentInfo()
{
with (window.document.frmCheckout) {
if (isEmpty(txtEmail, 'Please enter your email address')) {
return false;
} else {
return true;
}
}
}
The code above works but does not have the restriction I require. All I need is validation for the '@' character to be set in the text entry field. Please can someone help me with this.
Thank you in advance.