<!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><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>></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> var totalcount =
formObj.NumberOfTables.value;<BR> var tableformat =
formObj.TableFormat.value;<BR> var chairscount =
formObj.NumberOfChairs.value;<BR> var chairsformat =
formObj.ChairsFormat.value;<BR> var housekeepingrequest =
formObj.HousekeepingRequest.checked;<BR> var hrd =
formObj.HousekeepingRequestDate.value;<BR> var tvvcr =
formObj.TVVCR.value;<BR> <BR> if (totalcount > 1 &&
tableformat == "Not applicable") {<BR> alert("You must select a table
format when you have requested 2 or more
tables.");<BR> formObj.TableFormat.focus();<BR> return
false;<BR> }<BR> <BR> else if (chairscount > 1 &&
chairsformat == "Not applicable") {<BR> alert("You must select a
chairs format when you have requested 2 or more
chairs.");<BR> formObj.ChairsFormat.focus();<BR> return
false;<BR> }<BR> else if ((housekeepingrequest && hrd == "")
|| (housekeepingrequest && (hrd.length != 10 || hrd.charAt(4) != '-' ||
hrd.charAt(7) != '-' || (hrd.charAt(5) != 1 && hrd.charAt(5) != 0))))
{<BR> alert("You have selected housekeeping request. Therefore you
must include a valid housekeeping request date in the format
yyyy-mm-dd.");<BR> formObj.HousekeepingRequest.focus();<BR> return
false;<BR> }<BR> else if (tvvcr < 0 || tvvcr > 2)
{<BR> alert ("Invalid quantity of
tv/vcr.");<BR> formObj.TVVCR.focus();<BR> return
false;<BR> <BR> }<BR> 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> </DIV></BODY></HTML>