simon315
08-17-2002, 01:16 AM
Hi! I need some help creating a validation for a form of mine. I'm looking to do two validations. The first is to check to see if specific fields have been input(all or not all of them). The second validation is to look at the email address and make sure it is valid (containing the '@' symbol and possibly '.com, .edu, .org, etc'). Is this possible? Thanks in advance! Here is my form code:
<table width="360" CELLPADDING="3" CELLSPACING="0" BORDER="0">
<tr>
<td width="115">
<form METHOD="post" ENCTYPE="text/plain" ACTION="mailto:info@mycompany.com" NAME="inforequest" ID="information">
<b>Name:</b>
</td>
<td ALIGN="right">
<input NAME="fullname" ID="fullnameid" SIZE="30" MAXLENGTH="30">
</td>
</tr>
<tr>
<td>
<b>Company Name:</b>
</td>
<td ALIGN="right">
<input NAME="companyname" ID="company" SIZE="30" MAXLENGTH="30">
</td>
</tr>
<tr>
<td>
<b>Position:</b>
</td>
<td ALIGN="right">
<input NAME="position" ID="title" SIZE="30" MAXLENGTH="30">
</td>
</tr>
<tr>
<td>
<b>Telephone:</b>
</td>
<td ALIGN="right">
<input NAME="telephone" ID="phone" SIZE="30" MAXLENGTH="30">
</td>
</tr>
<tr>
<td>
<b>E.Mail Address:</b>
</td>
<td ALIGN="right">
<input NAME="emailaddress" ID="email" SIZE="30" MAXLENGTH="30">
</td>
</tr>
<tr>
<td COLSPAN="2">
<b>Request/Comments:</b>
</td>
</tr>
<tr>
<td COLSPAN="2" ALIGN="right" VALIGN="center"><TEXTAREA id=comments name=requestcomments rows=6 cols=36></TEXTAREA>
</td>
</tr>
<tr>
<td COLSPAN="2" ALIGN="middle" VALIGN="center">
<input TYPE="image" SRC="../images/button_submit_off.gif"
onMouseover="this.src='../images/button_submit_on.gif'"
onMouseout="this.src='../images/button_submit_off.gif'" VALUE="submit" BORDER="0" WIDTH="46"
HEIGHT="15" id=image1 name=image1><IMG src="../images/clear_pixel.gif" width=15><A
onmouseover=document.clear.src=button_reset_on.src onclick="javascript:document.inforequest.reset();return false"
onmouseout=document.clear.src=button_reset_off.src
href="#"><IMG
height=15 src="../images/button_reset_off.gif" width=46 border=0 name=clear></A></FORM>
</td>
</tr>
</table>
<table width="360" CELLPADDING="3" CELLSPACING="0" BORDER="0">
<tr>
<td width="115">
<form METHOD="post" ENCTYPE="text/plain" ACTION="mailto:info@mycompany.com" NAME="inforequest" ID="information">
<b>Name:</b>
</td>
<td ALIGN="right">
<input NAME="fullname" ID="fullnameid" SIZE="30" MAXLENGTH="30">
</td>
</tr>
<tr>
<td>
<b>Company Name:</b>
</td>
<td ALIGN="right">
<input NAME="companyname" ID="company" SIZE="30" MAXLENGTH="30">
</td>
</tr>
<tr>
<td>
<b>Position:</b>
</td>
<td ALIGN="right">
<input NAME="position" ID="title" SIZE="30" MAXLENGTH="30">
</td>
</tr>
<tr>
<td>
<b>Telephone:</b>
</td>
<td ALIGN="right">
<input NAME="telephone" ID="phone" SIZE="30" MAXLENGTH="30">
</td>
</tr>
<tr>
<td>
<b>E.Mail Address:</b>
</td>
<td ALIGN="right">
<input NAME="emailaddress" ID="email" SIZE="30" MAXLENGTH="30">
</td>
</tr>
<tr>
<td COLSPAN="2">
<b>Request/Comments:</b>
</td>
</tr>
<tr>
<td COLSPAN="2" ALIGN="right" VALIGN="center"><TEXTAREA id=comments name=requestcomments rows=6 cols=36></TEXTAREA>
</td>
</tr>
<tr>
<td COLSPAN="2" ALIGN="middle" VALIGN="center">
<input TYPE="image" SRC="../images/button_submit_off.gif"
onMouseover="this.src='../images/button_submit_on.gif'"
onMouseout="this.src='../images/button_submit_off.gif'" VALUE="submit" BORDER="0" WIDTH="46"
HEIGHT="15" id=image1 name=image1><IMG src="../images/clear_pixel.gif" width=15><A
onmouseover=document.clear.src=button_reset_on.src onclick="javascript:document.inforequest.reset();return false"
onmouseout=document.clear.src=button_reset_off.src
href="#"><IMG
height=15 src="../images/button_reset_off.gif" width=46 border=0 name=clear></A></FORM>
</td>
</tr>
</table>