Hi,
I have worked out the following coding to check the presence of an @ sign in a form when being filled in. The program works correctly. However i need that it checked for the presence of a . ( dot ) also. Can anybody help me please....i've been strunggling with this since 2 days.
I searched also in the forums, but the coding is too advanced. I was wondering if their is a coding similar to mine, listed below;
CODING OF FUNCTIONS PART;
=========================
function doemail()
{
if(document.form1.email.value.search("@")<0||document.form1.email.value.length==1)
{
alert("Email address is wrong. Please check !")
return false
}
else
{
return true
}
CODING OF FORM PART
===================
<tr>
<th align="left" width="279">Email Address</th>
<td width="461"><input type="text" name="email" size="30" maxlength="25" onChange="return doemail();"></td>
</tr>
================================
Can anybody guide me please,
Thank you
Salim
I have worked out the following coding to check the presence of an @ sign in a form when being filled in. The program works correctly. However i need that it checked for the presence of a . ( dot ) also. Can anybody help me please....i've been strunggling with this since 2 days.
I searched also in the forums, but the coding is too advanced. I was wondering if their is a coding similar to mine, listed below;
CODING OF FUNCTIONS PART;
=========================
function doemail()
{
if(document.form1.email.value.search("@")<0||document.form1.email.value.length==1)
{
alert("Email address is wrong. Please check !")
return false
}
else
{
return true
}
CODING OF FORM PART
===================
<tr>
<th align="left" width="279">Email Address</th>
<td width="461"><input type="text" name="email" size="30" maxlength="25" onChange="return doemail();"></td>
</tr>
================================
Can anybody guide me please,
Thank you
Salim