I have a form which I need to validate.
It is part of a dynamically created site and the HTML looks like this:
<FORM action="doaddvol.asp" method="post">
<TABLE cellspacing="0" cellpadding="3" border="0">
<TR>
<TD COLSPAN="5" class="headbox" align="center">
<span class="headtxt"><CENTER>Ne
w Instructor Event Instructors</span></CENTER
>
</TD>
</TR>
<TR>
<TD COLSPAN="5">
<CENTER><span class="smtxt">Click on the Instructor to edit / remove.</span></CENTER>
</TD>
</TR>
<TR>
<TD align="center"><b>First Name</b></TD>
<TD align="center"><b>Last Name</b></TD>
<TD align="center"><b>Phone Number</b></TD>
<TD align="center"><b>Function
</b></TD>
<TD align="center"><b>Entered By</b></TD>
</TR>
<TR>
<TD align="center"><INPUT TYPE="text" Name="VolFirst"></TD>
<TD align="center"><INPUT TYPE="text" Name="VolLast"></TD>
<TD align="center"><INPUT TYPE="text" Name="VolPhone" Size="12"></TD>
<TD align="center"><SELECT Name="EventJob">
<OPTION Value="Instructor">Instruc
tor</OPTIO
N>
<OPTION Value="Co-Instructor">Co-I
nstructor<
/OPTION>
<OPTION Value="Leader">Leader</OPT
ION>
<OPTION Value="Inst. Trainer">Inst. Trainer</OPTION>
<OPTION Value="Co-Inst. Trainer">Co-Inst. Trainer</OPTION>
</SELECT>
</TD>
<TD align="center"><INPUT TYPE="hidden" Name="EnteredBy" Value="bvinson">bvinson</T
D>
</TR>
<TR>
<TD align="center"><INPUT TYPE="text" Name="VolFirst"></TD>
<TD align="center"><INPUT TYPE="text" Name="VolLast"></TD>
<TD align="center"><INPUT TYPE="text" Name="VolPhone" Size="12"></TD>
<TD align="center"><SELECT Name="EventJob">
<OPTION Value="Instructor">Instruc
tor</OPTIO
N>
<OPTION Value="Co-Instructor">Co-I
nstructor<
/OPTION>
<OPTION Value="Leader">Leader</OPT
ION>
<OPTION Value="Inst. Trainer">Inst. Trainer</OPTION>
<OPTION Value="Co-Inst. Trainer">Co-Inst. Trainer</OPTION>
</SELECT>
</TD>
<TD align="center"><INPUT TYPE="hidden" Name="EnteredBy" Value="bvinson">bvinson</T
D>
</TR>
<TR>
<TD>0 of 2</TD>
<TD><INPUT TYPE="Reset"><INPUT TYPE="hidden" Name="EventID" Value= "55" align="right"></TD>
<TD><INPUT TYPE="Submit" Value="Add Instructors"></TD>
</TR>
<TR>
</TABLE>
</FORM>
OK. What happens when this form is submitted is that it goes to an ASP page which parses through the fields and inserts them into a database. I have the ASP page looking at the arrays that are sent over and entering the info only if the VolFirst field contains information. A problem is coming up in that you can enter the VolFirst and not the Phone. The database script dies if the VolPhone field is empty.
I need to use an advanced form validation to look through the form submission and if the VolFirst field contains information, then it checks to see if the VolPhone instance also contains information and stops the submission if it does not. If there are multiple fields (such as in the example) I want users to be able to enter information in the first line but not in the second and the form validate successfully. Also, of course, they should be able to enter in all the fields and have a successful validation.
Its 5:00 on Friday, so I may not be able to check for correct responses until Monday.
Thank you in advance for your assistance.
bvinson