<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">


<META content="MSHTML 5.00.2919.6307" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT size=2><SPAN class=636470622-27012003><FONT face=Arial>I call a 
function called ValidateThis in my FORM: <FONT color=#000000 size=1></FONT>
<P></FONT><FONT face=Arial><FONT color=#0000c0>&lt;FORM name=</FONT><FONT 
color=#000000>"myform"</FONT><FONT color=#0000c0> method=</FONT><FONT 
color=#000000>"POST"</FONT><FONT color=#0000c0> action=</FONT><FONT 
color=#000000>"ProgramPlanning2.asp"</FONT><FONT color=#0000c0> 
onSubmit=</FONT><FONT color=#000000>"return ValidateThis(myform)"</FONT><FONT 
color=#0000c0>&gt;</FONT> </FONT></P>
<P><FONT face=Arial><SPAN class=636470622-27012003>The function is as 
follows:</SPAN></FONT></P>
<P><FONT color=#0000c0 face=Arial><SPAN class=636470622-27012003>function 
ValidateThis(formObj)<BR>{<BR>&nbsp;var totalcount = 
formObj.NumberOfTables.value;<BR>&nbsp;var tableformat = 
formObj.TableFormat.value;<BR>&nbsp;var chairscount = 
formObj.NumberOfChairs.value;<BR>&nbsp;var chairsformat = 
formObj.ChairsFormat.value;<BR>&nbsp;var housekeepingrequest = 
formObj.HousekeepingRequest.checked;<BR>&nbsp;var hrd = 
formObj.HousekeepingRequestDate.value;<BR>&nbsp;var tvvcr = 
formObj.TVVCR.value;<BR>&nbsp;<BR>&nbsp;if (totalcount &gt; 1 &amp;&amp; 
tableformat == "Not applicable") {<BR>&nbsp;&nbsp;alert("You must select a table 
format when you have requested 2 or more 
tables.");<BR>&nbsp;&nbsp;formObj.TableFormat.focus();<BR>&nbsp;&nbsp;return 
false;<BR>&nbsp;}<BR>&nbsp;<BR>&nbsp;else if (chairscount &gt; 1 &amp;&amp; 
chairsformat == "Not applicable") {<BR>&nbsp;&nbsp;alert("You must select a 
chairs format when you have requested 2 or more 
chairs.");<BR>&nbsp;&nbsp;formObj.ChairsFormat.focus();<BR>&nbsp;&nbsp;return 
false;<BR>&nbsp;}<BR>&nbsp;else if ((housekeepingrequest &amp;&amp; hrd == "") 
|| (housekeepingrequest &amp;&amp; (hrd.length != 10 || hrd.charAt(4) != '-' || 
hrd.charAt(7) != '-' || (hrd.charAt(5) != 1 &amp;&amp; hrd.charAt(5) != 0)))) 
{<BR>&nbsp;&nbsp;alert("You have selected housekeeping request. Therefore you 
must include a valid housekeeping request date in the format 
yyyy-mm-dd.");<BR>&nbsp;&nbsp;formObj.HousekeepingRequest.focus();<BR>&nbsp;&nbsp;return 
false;<BR>&nbsp;}<BR>&nbsp;else if (tvvcr &lt; 0 || tvvcr &gt; 2) 
{<BR>&nbsp;&nbsp;alert ("Invalid quantity of 
tv/vcr.");<BR>&nbsp;&nbsp;formObj.TVVCR.focus();<BR>&nbsp;&nbsp;return 
false;<BR>&nbsp;<BR>&nbsp;}<BR>&nbsp;else return true;<BR>}</SPAN></FONT></P>
<P><FONT face=Arial><SPAN class=636470622-27012003>What I am realizing is that I 
have another 6 or 7 FORM fields that need to be included in the data validation 
that are similar to tvvcr. I suppose for each one I could add an additional line 
such as var videocams = formObj.VideoCams.value; and add another else if section 
to test for the quantity requested is no more than 2. However, any ideas how I 
can perhaps do this in another function that is called from the main function 
please. Thanks. </SPAN></FONT></P></SPAN></FONT></DIV>
<DIV>&nbsp;</DIV></BODY></HTML>