[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Compound IF used to validate checkbox series on a form failing to catch error

Posted on 2005-04-06
19
Medium Priority
?
296 Views
Last Modified: 2008-02-01
I have a LENGTHY form with many checkboxes.  There are 3 checkboxes that should not be checked without checking at least one other checkbox from another group.  That is, you should not be able to submit the form with checkbox b1, b2, or b3 checked if you haven't also checked a box from group A (checkbox a1, a2,....an).

In addition, the form should not submit if you've left any of the main contact fields blank (name, email, phone).

Before I added the 'checkbox checking code' the 'checking for blanks' portion of the validate worked fine.  Now nothing works.

Here is a portion of the validate code; below that is the form tag.

function validateForm(form) {
      var num_errors = 0;
      var alert_msg = "";
               if (!validateContents(form.phone)) {
            alert_msg += "    - Phone is required\n";
            num_errors++;
      }
      
      if (!validateServices1()) {
            alert_msg += "     - The Eye/Lip services must be part of a Body Treatment, Facial or Wax.  Please select a service.\n";
            num_errors++;
      }
      
      if (num_errors == 0)
            return true;
      
      if (num_errors == 1)
            alert_msg = "The following form field is incomplete or incorrect:\n\n" + alert_msg + "\nPlease complete or correct the form and resubmit.";
      else // if num_errors > 1
            alert_msg = "The following form fields are incomplete or incorrect:\n\n" + alert_msg + "\nPlease complete or correct the form and resubmit.";

      alert(alert_msg);
      return false;
}

function validateContents(contents) { // check whether given field value is empty
      if (contents.value == "")
            return false;
      else return true;
}

function validateServices1()  {
      if ((form.eyeslips1.checked || form.eyeslips2.checked || form.eyeslips4.checked) && 
            (!(form.body1.checked && form.body2.checked && form.body3.checked &&
                  form.body4.checked && form.body5.checked && form.body6.checked &&
                    form.body7.checked && form.body8.checked && form.body9.checked &&
                    form.body10.checked && form.body11.checked && form.body12.checked &&
                    form.body13.checked && form.body14.checked && form.body15.checked &&
              form.facials1.checked && form.facials2.checked && form.facials3.checked &&
              form.facials4.checked && form.facials5.checked && form.facials6.checked &&
              form.facials7.checked && form.facials8.checked && form.facials9.checked &&
              form.facials10.checked && form.facials11.checked && form.facials12.checked &&
                    form.facials13.checked && form.facials14.checked && form.facials15.checked && form.facials16.checked &&
              form.waxing1.checked && form.waxing2.checked && form.waxing3.checked &&
                  form.waxing4.checked && form.waxing5.checked && form.waxing6.checked &&
                    form.waxing7.checked && form.waxing8.checked && form.waxing9.checked &&
                    form.waxing10.checked && form.waxing11.checked && form.waxing12.checked &&
                    form.waxing13.checked && form.eyeslips3.checked)))
            return false;
      else
            return true;
}

<form action='process.php' method="post" id=form1 name=form1 onsubmit="return validateForm(this);">

NOTE:  If I remove the validateServices1() function call, the rest of the validateForm code works properly.
if (!validateServices1()) {
         alert_msg += "     - The Eye/Lip services must be part of a Body Treatment, Facial or Wax.  Please select a service.\n";
        num_errors++;
}

I've assigned 500 pts because I'd appreciate an answer as soon as possible.

Thanks for your assistance.
0
Comment
Question by:imuhlenkamp
  • 9
  • 7
  • 3
19 Comments
 
LVL 25

Expert Comment

by:archrajan
ID: 13720523
Post the view source from your browser..
That wud be easier to debug
0
 
LVL 25

Expert Comment

by:archrajan
ID: 13720532
may be u shud call it like this:
 if (!validateServices1(form))

u shud pass the argument form for reference in that function
0
 

Author Comment

by:imuhlenkamp
ID: 13720545
Here's a copy of the page code from the View, Source window.

<html>
<head>
<title>About   ::   OSIRIS Wellness and Day Spa</title>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<!-- Fireworks MX Dreamweaver MX target.  Created Mon Sep 27 22:49:25 GMT-0400 (Eastern Standard Time) 2004-->

<style type="text/css">
.mainmenu{
cursor:pointer;
color: #990000;
font-weight: bold;
font-size: 11px;
font-family: Verdana, Arial, Helvetica, sans-serif;
text-decoration: none;
line-height: 15px;
}

.submenu{
margin-bottom: 0.5em;
}
</style>

<script language="JavaScript">
<!--

function SymError()
{
  return true;
}

window.onerror = SymError;

//-->
</script>

<SCRIPT LANGUAGE=javascript>
function disableRightClick(e)
{
  var message = "These images are the sole property of OSIRIS Wellness and Day Spa";
 
  if(!document.rightClickDisabled) // initialize
  {
    if(document.layers)
    {
      document.captureEvents(Event.MOUSEDOWN);
      document.onmousedown = disableRightClick;
    }
    else document.oncontextmenu = disableRightClick;
    return document.rightClickDisabled = true;
  }
  if(document.layers || (document.getElementById && !document.all))
  {
    if (e.which==2||e.which==3)
    {
      alert(message);
      return false;
    }
  }
  else
  {
    alert(message);
    return false;
  }
}
disableRightClick();

<!--
/* Functions that swaps images and Functions that handle preload. */
function MM_preloadImages() { //v3.0
 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
   var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
   if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function showDiv(refselect) {
  theLayer = (document.getElementById)? document.getElementById("layer1"):document.all("layer1");
  if(refselect.selectedIndex==5 || refselect.selectedIndex==6 || refselect.selectedIndex==7 || refselect.selectedIndex==8 || refselect.selectedIndex==9) vis="visible"
  else vis = "hidden"
  theLayer.style.visibility=vis;
}  
/***********************************************
* Switch Menu script- by Martial B of http://getElementById.com/
* Modified by Dynamic Drive for format & NS4/IE4 compatibility
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

if (document.getElementById){ //DynamicDrive.com change
document.write('<style type="text/css">\n')
document.write('.submenu{display: none;}\n')
document.write('</style>\n')
}

/* Functions that handle service menus. */
/*function SwitchMenu(obj){
      if(document.getElementById){
      var el = document.getElementById(obj);
      var ar = document.getElementById("masterdiv").getElementsByTagName("span"); //DynamicDrive.com change
            if(el.style.display != "block"){ //DynamicDrive.com change
                  for (var i=0; i<ar.length; i++){
                        if (ar[i].className=="submenu") //DynamicDrive.com change
                        ar[i].style.display = "none";
                  }
                  el.style.display = "block";
            }else{
                  el.style.display = "none";
            }
      }
}*/
function SwitchMenu(obj){
     if(document.getElementById)
      {
     var el = document.getElementById(obj);
     if(el.style.display != "block") el.style.display = "block";
     else el.style.display = "none";
     }
}
function validateForm(form) { // validate that required fields are non-empty & check email
                                                                  // address format
      var num_errors = 0;
      var alert_msg = "";
      if (!validateContents(form.clientname)) {
            alert_msg += "    - A name is required\n";
            num_errors++;
      }
      
      if (!validateContents(form.email)) {
            alert_msg += "    - Email address is required\n";
            num_errors++;
      }
      else if (!validateEmail(form.email)) {
            alert_msg += "    - Email address format is incorrect\n";
            num_errors++;
      }
      if (!validateContents(form.address1)) {
            alert_msg += "    - Address is required\n";
            num_errors++;
      }
      
      if (!validateContents(form.city)) {
            alert_msg += "    - City is required\n";
            num_errors++;
      }
      if (!validateContents(form.state)) {
            alert_msg += "    - State is required\n";
            num_errors++;
      }
      if (!validateContents(form.zip)) {
            alert_msg += "    - Zip code is required\n";
            num_errors++;
      }
      
      if (!validateContents(form.phone)) {
            alert_msg += "    - Phone is required\n";
            num_errors++;
      }
      
      if (!validateServices1()) {
            alert_msg += "     - The Eye/Lip services must be part of a Body Treatment, Facial or Wax.  Please select a service.\n";
            num_errors++;
      }
      
      if (num_errors == 0)
            return true;
      
      if (num_errors == 1)
            alert_msg = "The following form field is incomplete or incorrect:\n\n" + alert_msg + "\nPlease complete or correct the form and resubmit.";
      else // if num_errors > 1
            alert_msg = "The following form fields are incomplete or incorrect:\n\n" + alert_msg + "\nPlease complete or correct the form and resubmit.";

      alert(alert_msg);
      return false;
}

function validateContents(contents) { // check whether given field value is non-empty
      if (contents.value == "")
            return false;
      else return true;
}

function validateServices1()  {
      if ((form.eyeslips1.checked || form.eyeslips2.checked || form.eyeslips4.checked) && 
            (!(form.body1.checked && form.body2.checked && form.body3.checked &&
                  form.body4.checked && form.body5.checked && form.body6.checked &&
                    form.body7.checked && form.body8.checked && form.body9.checked &&
                    form.body10.checked && form.body11.checked && form.body12.checked &&
                    form.body13.checked && form.body14.checked && form.body15.checked &&
                    form.facials1.checked && form.facials2.checked && form.facials3.checked &&
                    form.facials4.checked && form.facials5.checked && form.facials6.checked &&
                    form.facials7.checked && form.facials8.checked && form.facials9.checked &&
                    form.facials10.checked && form.facials11.checked && form.facials12.checked &&
                    form.facials13.checked && form.facials14.checked && form.facials15.checked && form.facials16.checked &&
                    form.waxing1.checked && form.waxing2.checked && form.waxing3.checked &&
                  form.waxing4.checked && form.waxing5.checked && form.waxing6.checked &&
                    form.waxing7.checked && form.waxing8.checked && form.waxing9.checked &&
                    form.waxing10.checked && form.waxing11.checked && form.waxing12.checked &&
                    form.waxing13.checked && form.eyeslips3.checked)))
            return false;
      else
            return true;
}
      
function validateEmail(email) { // check whether given field value has structure of email address
      var result = false;
      var email_str = new String(email.value);
      var at_index = email_str.indexOf("@");
      if (at_index > 0) {
            var period_index = email_str.indexOf(".", at_index);
            if (period_index > at_index + 1 && email_str.length > period_index + 1)
                  result = true;
      }
      return result;
}

//-->
</script>
<!--Call for price pop-up window-->
<script language="javascript" src="../pricewin.js"></script>
<link href="../styles.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style2 {font-size: 14px}
.style5 {font-size: 10}
-->
</style>
</head>
<body bgcolor="#ffffff" onLoad="MM_preloadImages('../images/body_care_f2.gif','../images/skin_care_f2.gif','../images/wellness_f2.gif','../images/gift_ideas_f2.gif','../images/products_f2.gif','../images/service_menu_f2.gif','../images/appointment_f2.gif','../images/calendar_f2.gif','../images/terms_f2.gif','../images/contact_f2.gif','../images/about_f2.gif','../images/buy_giftcard_f2.gif')">
<!--The following section is an HTML table which reassembles the sliced image in a browser.-->
<!--Copy the table section including the opening and closing table tags, and paste the data where-->
<!--you want the reassembled image to appear in the destination document. -->
<!--======================== BEGIN COPYING THE HTML HERE ==========================-->
<!--========================= STOP COPYING THE HTML HERE =========================-->
<table border="0" cellpadding="0" cellspacing="2" width="98%">
  <tr>
    <td></td>
    <td></td>
    <td></td>
  </tr>
  <tr>
    <td></td>
    <td>
<div align="center">
<table width="750" border="2" cellpadding="0" cellspacing="0">
          <tr>
            <td width="757"><table border="0" cellpadding="0" cellspacing="0" width="750">
                <!-- fwtable fwsrc="About-Build_File.png" fwbase="about.gif" fwstyle="Dreamweaver" fwdocid = "742308039" fwnested="0" -->
                <tr>
                  <!-- Shim row, height 1. -->
                  <td width="10"><img src="../images/spacer.gif" width="10" height="1" border="0" alt=""></td>
                  <td width="53"><img src="../images/spacer.gif" width="53" height="1" border="0" alt=""></td>
                  <td width="26"><img src="../images/spacer.gif" width="26" height="1" border="0" alt=""></td>
                  <td width="9"><img src="../images/spacer.gif" width="9" height="1" border="0" alt=""></td>
                  <td width="8"><img src="../images/spacer.gif" width="8" height="1" border="0" alt=""></td>
                  <td width="28"><img src="../images/spacer.gif" width="28" height="1" border="0" alt=""></td>
                  <td width="77"><img src="../images/spacer.gif" width="77" height="1" border="0" alt=""></td>
                  <td width="12"><img src="../images/spacer.gif" width="12" height="1" border="0" alt=""></td>
                  <td width="5"><img src="../images/spacer.gif" width="5" height="1" border="0" alt=""></td>
                  <td width="13"><img src="../images/spacer.gif" width="13" height="1" border="0" alt=""></td>
                  <td width="15"><img src="../images/spacer.gif" width="15" height="1" border="0" alt=""></td>
                  <td width="55"><img src="../images/spacer.gif" width="55" height="1" border="0" alt=""></td>
                  <td width="13"><img src="../images/spacer.gif" width="13" height="1" border="0" alt=""></td>
                  <td width="10"><img src="../images/spacer.gif" width="10" height="1" border="0" alt=""></td>
                  <td width="10"><img src="../images/spacer.gif" width="10" height="1" border="0" alt=""></td>
                  <td width="80"><img src="../images/spacer.gif" width="80" height="1" border="0" alt=""></td>
                  <td width="11"><img src="../images/spacer.gif" width="11" height="1" border="0" alt=""></td>
                  <td width="22"><img src="../images/spacer.gif" width="22" height="1" border="0" alt=""></td>
                  <td width="29"><img src="../images/spacer.gif" width="29" height="1" border="0" alt=""></td>
                  <td width="16"><img src="../images/spacer.gif" width="16" height="1" border="0" alt=""></td>
                  <td width="14"><img src="../images/spacer.gif" width="14" height="1" border="0" alt=""></td>
                  <td width="51"><img src="../images/spacer.gif" width="51" height="1" border="0" alt=""></td>
                  <td width="8"><img src="../images/spacer.gif" width="8" height="1" border="0" alt=""></td>
                  <td width="43"><img src="../images/spacer.gif" width="43" height="1" border="0" alt=""></td>
                  <td width="44"><img src="../images/spacer.gif" width="44" height="1" border="0" alt=""></td>
                  <td width="78"><img src="../images/spacer.gif" width="78" height="1" border="0" alt=""></td>
                  <td width="9"><img src="../images/spacer.gif" width="9" height="1" border="0" alt=""></td>
                  <td width="4"><img src="../images/spacer.gif" width="1" height="1" border="0" alt=""></td>
                  <td width="10"><img src="../images/spacer.gif" width="1" height="1" border="0" alt=""></td>
                </tr>
                <tr>
                  <!-- row 1 -->
                  <td colspan="28"><img name="slice" src="../images/slice.gif" width="750" height="100%" border="0" alt=""></td>
                  <td><img src="../images/spacer.gif" width="1" height="100%" border="0" alt=""></td>
                </tr>
                <tr>
                  <!-- row 2 -->
                  <td colspan="27"><a href="../index.html" target="_self"><img name="about_header" src="../images/about_header.jpg" width="749" height="90" border="0" alt="About Osiris Wellness and Day Spa"></a></td>
                  <td rowspan="11"><img name="slice" src="../images/slice.gif" width="1" height="100%" border="0" alt=""></td>
                  <td><img src="../images/spacer.gif" width="1" height="100%" border="0" alt=""></td>
                </tr>
                <tr>
                  <!-- row 3 -->
                  <td colspan="27"><img name="about_quote" src="../images/about_quote.gif" width="750" height="28" border="0" alt="Live life in complete balance and harmony leaving everyday stresses behind."></td>
                  <td><img src="../images/spacer.gif" width="1" height="100%" border="0" alt=""></td>
                </tr>
                <tr>
                  <!-- row 4 -->
                  <td colspan="5"><a href="../body/index.html" target="_self" onMouseOut="MM_swapImgRestore();" onMouseOver="MM_swapImage('body_care','','../images/body_care_f2.gif',1)"><img name="body_care" src="../images/body_care.gif" width="106" height="23" border="0" alt="Body Care"></a></td>
                  <td colspan="3"><a href="../skin/index.html" target="_self" onMouseOut="MM_swapImgRestore();" onMouseOver="MM_swapImage('skin_care','','../images/skin_care_f2.gif',1)"><img name="skin_care" src="../images/skin_care.gif" width="117" height="23" border="0" alt="Skin Care"></a></td>
                  <td colspan="6"><a href="../wellness/index.html" target="_self" onMouseOut="MM_swapImgRestore();" onMouseOver="MM_swapImage('wellness','','../images/wellness_f2.gif',1)"><img name="wellness" src="../images/wellness.gif" width="111" height="23" border="0" alt="Wellness"></a></td>
                  <td colspan="7"><a href="../gifts/index.html" target="_self" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('gift_ideas','','../images/gift_ideas_f2.gif',1)"><img name="gift_ideas" src="../images/gift_ideas.gif" width="182" height="23" border="0" alt="Gift Ideas and Packages"></a></td>
                  <td colspan="3"><a href="../products/index.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('products_ro','','../images/products_f2.gif',1)"><img src="../images/products.gif" alt="Products" name="products_ro" width="102" height="23" border="0"></a></td>
                  <td colspan="3"><a href="../about/index.html" target="_self" onMouseOver="MM_swapImage('about','','../images/about_f2.gif',1)" onMouseOut="MM_swapImgRestore()"><img name="about" src="../images/about.gif" width="131" height="23" border="0" alt="About OSIRIS"></a></td>
                  <td><img src="../images/spacer.gif" width="1" height="23" border="0" alt=""></td>
                </tr>
                <tr>
                  <!-- row 5 -->
                  <td colspan="2">&nbsp;</td>
                  <td colspan="4">&nbsp;</td>
                  <td colspan="5">&nbsp;</td>
                  <td colspan="4">&nbsp;</td>
                  <td colspan="3">&nbsp;</td>
                  <td colspan="5">&nbsp;</td>
                  <td colspan="2">&nbsp;</td>
                  <td colspan="2">&nbsp;</td>
                  <td><img src="../images/spacer.gif" width="1" height="100%" border="0" alt=""></td>
                </tr>
                <tr>
                  <!-- row 6 -->
                  <td colspan="27"><img name="nav_spacer" src="../images/nav_spacer.gif" width="749" height="100%" border="0" alt=""></td>
                  <td><img src="../images/spacer.gif" width="1" height="100%" border="0" alt=""></td>
                </tr>
                <tr>
                  <!-- row 7 -->
                  <td colspan="27"><img src="../images/appt_title.gif" alt="Appointments at OSIRIS" name="appt_title" width="750" height="28" id="appt_title"></td>
                  <td><img src="../images/spacer.gif" width="1" height="100%" border="0" alt=""></td>
                </tr>
                <tr>
                  <!-- row 8 -->
                  <td colspan="27"><img name="title_spacer" src="../images/title_spacer.gif" width="749" height="100%" border="0" alt=""></td>
                  <td><img src="../images/spacer.gif" width="1" height="100%" border="0" alt=""></td>
                </tr>
                <tr>
                  <!-- row 9 -->
                  <td rowspan="2"><img name="column_spacer1" src="../images/column_spacer1.gif" width="10" height="318" border="0" alt=""></td>
                  <td colspan="9"  valign="top"><p align="left"><span class="bodytext">OSIRIS
                         welcomes you. Our hours of operation are Wednesday through
                        Saturday 9:00 a.m. to 7:00 p.m. by appointment only.
                        While we gladly accommodate last minute requests when
                        space is available, we suggest scheduling your appointment
                        at least 24 hours in advance and we encourage you to
                        arrive early to enjoy the ambiance and amenities that
                        OSIRIS has to offer.<br>
                        <br>
                      A spa assistant will contact you
                      after receiving the request to finalize the details of
                      your visit.<br>
                      </span><br>
                      <span class="smblack"><strong>For immediate assistance...</strong></span><span class="bodytext"><br>
                      please call 724-538-4004 and one of our spa professionals
                      will be happy to answer your questions and reserve your
                      desired treatment times.<BR>
                      <BR>
                      <em>Items marked with * are required fields.</em></span></p>
                   
                    <a href="gift_request_form.html"><img src="../images/buy_giftcard.gif" name="giftcard" width="221" height="25" border="0" id="giftcard" onMouseOver="MM_swapImage('giftcard','','../images/buy_giftcard_f2.gif',1)" onMouseOut="MM_swapImgRestore()"></a>
                    <table width="100%"  border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td align="left" valign="top">                                    </td>
                      </tr>
                    </table>                    <p align="left">&nbsp;</p>                    
                    <p align="left"><font size="-2" ><span class="smblack"><strong><span class="bodytext">
                      </span></strong></span><br>
                      </font></p></td>
                  <td rowspan="2"><img name="column_spacer2" src="../images/column_spacer2.gif" width="15" height="318" border="0" alt=""></td>
                  <td colspan="15" rowspan="2"  valign="top">
                          <form action='appt_request_process.php' method="post" id=form1 name=form1 onsubmit="return validateForm(this);">
                      <div align="left">
                        <table width="475" border="0" cellpadding="2" cellspacing="2">
                          <tr>
                            <td valign="top" class="smblack"><b>Name:*</b></td>
                            <td colspan="2" class="subtitle"><span class="bodytext">
                              <input name="clientname" id="clientname" size="40" />
                            </span></td>
                          </tr>
                          <tr>
                            <td valign="top" class="smblack"><b>E-Mail:*</b></td>
                            <td colspan="2" class="subtitle"><span class="bodytext">
                              <input size="40" name="email" />
                            </span></td>
                          </tr>
                          <tr>
                            <td valign="top" class="smblack"><b>Address 1:*</b></td>
                            <td colspan="2" class="subtitle"><span class="bodytext">
                              <input size="40" name="address1" />
                            </span></td>
                          </tr>
                          <tr>
                            <td valign="top" class="smblack"><b>Address 2:</b></td>
                            <td colspan="2" class="subtitle"><span class="bodytext">
                              <input size="40" name="address2" />
                            </span></td>
                          </tr>
                          <tr>
                            <td valign="top" class="smblack"><b>City:&nbsp;*&nbsp;</b></td>
                            <td colspan="2" class="subtitle"><span class="bodytext">
                              <input size="40" name="city" />
                            </span></td>
                          </tr>
                          <tr>
                            <td valign="top" class="smblack"><b>State:&nbsp;*&nbsp;</b></td>
                            <td colspan="2" class="subtitle"><span class="bodytext">
                              <select name="state">
                                <option value=""
              selected="selected"></option>
                                <option value="AA">AA</option>
                                <option value="AE">AE</option>
                                <option value="AL">AL</option>
                                <option
              value="AK">AK</option>
                                <option value="AP">AP</option>
                                <option value="AR">AR</option>
                                <option
              value="AZ">AZ</option>
                                <option value="CA">CA</option>
                                <option
              value="CO">CO</option>
                                <option value="CT">CT</option>
                                <option
              value="DE">DE</option>
                                <option value="DC">DC</option>
                                <option
              value="FL">FL</option>
                                <option value="GA">GA</option>
                                <option
              value="HI">HI</option>
                                <option value="ID">ID</option>
                                <option
              value="IL">IL</option>
                                <option value="IN">IN</option>
                                <option
              value="IA">IA</option>
                                <option value="KS">KS</option>
                                <option
              value="KY">KY</option>
                                <option value="LA">LA</option>
                                <option
              value="ME">ME</option>
                                <option value="MD">MD</option>
                                <option
              value="MA">MA</option>
                                <option value="MI">MI</option>
                                <option
              value="MN">MN</option>
                                <option value="MS">MS</option>
                                <option
              value="MO">MO</option>
                                <option value="MT">MT</option>
                                <option
              value="NE">NE</option>
                                <option value="NV">NV</option>
                                <option
              value="NH">NH</option>
                                <option value="NJ">NJ</option>
                                <option
              value="NM">NM</option>
                                <option value="NY">NY</option>
                                <option
              value="NC">NC</option>
                                <option value="ND">ND</option>
                                <option
              value="OH">OH</option>
                                <option value="OK">OK</option>
                                <option
              value="OR">OR</option>
                                <option value="PA">PA</option>
                                <option
              value="RI">RI</option>
                                <option value="SC">SC</option>
                                <option
              value="SD">SD</option>
                                <option value="TN">TN</option>
                                <option
              value="TX">TX</option>
                                <option value="UT">UT</option>
                                <option
              value="VT">VT</option>
                                <option value="VA">VA</option>
                                <option
              value="WA">WA</option>
                                <option value="WV">WV</option>
                                <option
              value="WI">WI</option>
                                <option value="WY">WY</option>
                              </select>
                            </span></td>
                          </tr>
                          <tr>
                            <td valign="top" class="smblack"><b>Zip:&nbsp;*</b></td>
                            <td colspan="2" class="subtitle"><span class="bodytext">
                              <input name="zip" />
                            </span></td>
                          </tr>
                          <tr>
                            <td valign="top" class="smblack"><strong>Daytime
                            Phone:*</strong></td>
                            <td colspan="2" class="subtitle"><span class="bodytext">
                              <input name="phone" type="text" id="phone" size="20" maxlength="20" />
                              <select name="phonetype" id="phonetype">
                                <option value="Home" selected="selected">Home</option>
                                <option value="Work">Work</option>
                                <option value="Cell">Mobile/Cellular</option>
                              </select>
                            </span></td>
                          </tr>
                          <tr>
                            <td width="125" valign="top" class="smblack"><strong>Have
                              you been to <br>
                            the spa before? </strong></td>
                            <td colspan="2" class="subtitle"><span class="bodytext">
                              <select name="repeater" id="repeater">
                                <option value="No" selected="selected">No</option>
                                <option value="Yes">Yes</option>
                              </select>
                              </span></td>
                          </tr>
                          <tr>
                            <td width="125" valign="top" class="smblack"><b>How
                              did you <br>
                            hear about us?&nbsp;</b></td>
                            <td colspan="2" class="subtitle"><select name="select_option" class="bodytextlarge" onChange="showDiv(this)">
                                <option value="No Answer" selected>Please Select...</option>
                                <option value="Website">Website</option>
                                <option value="Web Search">Web search</option>
                                <option value="Word of Mouth">Word of Mouth</option>
                                <option value="Phone Book">Phone Book</option>
                                <option value="Referral By-">Referral; If so, by whom?</option>
                                <option value="Radio Ad-">Radio Ad; If so, which station?</option>
                                <option value="Mag Ad-">Magazine Ad; If so, which mag?</option>
                                <option value="Newspaper Ad-">Newspaper Ad; If so, which paper?</option>
                                <option value="Other-">Other? Please specify.</option>
                              </select> <div id="layer1" name="layer1" style="VISIBILITY: hidden">
                                <input name="srchString" type="text" class="bodytextlarge" size="20">
                              </div></td>
                          </tr>
                          <tr>
                            <td width="125" valign="top" class="smblack"><strong>How
                              many people<BR>
                            will receive service? </strong></td>
                            <td colspan="2" valign="middle" class="subtitle"><input name="nbrappts" type="text" class="bodycopyLARGE" id="nbrappts" value="1" size="4" maxlength="2"></td>
                          </tr>
                          <tr valign="top">
                            <td width="125" class="smblack">&nbsp;</td>
                            <td width="350" class="subtitle">                          
                          </tr>
                          <tr valign="top">
                            <td class="smblack"><strong>Reserve the<BR>
Massage Suite for:</strong></td>
                            <td class="bodytext"><p>
                              <label>
                              <input type="radio" name="massage_suite" value="Suite for 2">2 persons</label>
                              <label>
                              <input type="radio" name="massage_suite" value="Suite for 3">3 persons</label>
                              <label>
                              <input type="radio" name="massage_suite" value="Suite for 4">4 persons</label>
                              <br>
                            </p>                          </tr>
                          <tr valign="top">
                            <td width="125" valign="top" class="smblack"><span class="smblack"><strong>Select
                            service(s): </strong></span><br> </td>
                            <td width="350"> <div id="masterdiv">
                                <div class="mainmenu" onclick="SwitchMenu('sub1')">Massage Therapies</div>
                                <span class="submenu" id="sub1">
                                <input name="massage1" type="checkbox" id="massage1" value="Aromatherapy Massage">Aromatherapy<br>
                                                <input name="massage2" type="checkbox" id="massage2" value="Hot Stone Massage">Hot Stone Therapy<br>
                                                <input name="massage3" type="checkbox" id="massage3" value="Infant Massage">Infant Massage<br>
                                                <input name="massage4" type="checkbox" id="massage4" value="Orthopedic Massage">Orthopedic Massage<br>
                                                <input name="massage5" type="checkbox" id="massage5" value="Pregnancy Massage">Pregnancy Massage<br>
                                                <input name="massage6" type="checkbox" id="massage6" value="Reflexology">Reflexology<br>
                                                <input name="massage7" type="checkbox" id="massage7" value="Sports Massage">Sports<br>
                                                <input name="massage8" type="checkbox" id="massage8" value="Swedish Massage">Swedish<br>
                                <input name="massage9" type="checkbox" id="massage9" value="Swedish/Deep Tissue Massage">Swedish/Deep Tissue Massage<br>
                                </span>
                                <div class="mainmenu" onclick="SwitchMenu('sub2')">Alternative Therapies</div>
                                <span class="submenu" id="sub2">
                                <input name="alternative1" type="checkbox" id="alternative1" value="Master Bodywork Massage">Master Bodywork Therapy<br>
                                                <input name="alternative2" type="checkbox" id="alternative2" value="Restorative Healing Massage">OSIRIS Restorative Healing Massage<br>
                                                <input name="alternative3" type="checkbox" id="alternative3" value="Reiki Massage">Reiki<br>
                                <input name="alternative4" type="checkbox" id="alternative4" value="Shiatsu Massage">Shiatsu<br>
                                                <input name="alternative5" type="checkbox" id="alternative5" value="Thai Yoga Massage">Thai Yoga Massage<br>
                                                <input name="alternative6" type="checkbox" id="alternative6" value="Tui Na Massage">Tui Na Massage<br>
                                </span>
                                                 <div class="mainmenu" onclick="SwitchMenu('sub3')">Body Treatments</div>
                                 <span class="submenu" id="sub3">
                                <input name="body1" type="checkbox" id="body1" value="Aromatherapy Body Wrap">Anti-Stress Aromatherapy Body Wrap<br>
                                                <input name="body2" type="checkbox" id="body2" value="Aromatherapy Salt Glow">Aromatherapy Salt Glow<br>
                                                <input name="body3" type="checkbox" id="body3" value="Body Bronzing">Body Bronzing Treatment<br>
                                                <input name="body4" type="checkbox" id="body4" value="Back Treatment">Customized Back Treatment<br>
                                <input name="body5" type="checkbox" id="body5" value="Sand Body Wrap">Desert Sand Body Wrap<br>
                                <input name="body6" type="checkbox" id="body6" value="Cellulite Wrap">Detoxifying Cellulite Wrap<br>
                                                <input name="body7" type="checkbox" id="body7" value="Seaweed Body Peel">Detoxifying, Exfoliating Seaweed Body Peel<br>
                                                <input name="body8" type="checkbox" id="body8" value="Este Buste">Este Buste Treatment<br>
                                                <input name="body9" type="checkbox" id="body9" value="Gentle Body Polish">Gentle Body Polish<br>
                                <input name="body10" type="checkbox" id="body10" value="Seaweed Body Wrap">Hydrating, Firming Seaweed Body Wrap<br>
                                <input name="body11" type="checkbox" id="body11" value="Moor Relief Body Treatment">”Moor” Relief For Your Body<br>
                                <input name="body12" type="checkbox" id="body12" value="Moroccan Cocoon">Moroccan Cocoon with Rassoul<br>
                                <input name="body13" type="checkbox" id="body13" value="OSIRIS Cellulite Body Treatment">OSIRIS “Intensive” Cellulite Body Treatment<br>
                                <input name="body14" type="checkbox" id="body14" value="Water Lily Wrap">Water Lily – After Sun Soothing Wrap<br>
                                                <input name="body15" type="checkbox" id="body15" value="3-in-1 Body Treatment">3-in-1 Treatment<br>
                                </span>
                                                <div class="mainmenu" onclick="SwitchMenu('sub4')">Facials</div>
                                <span class="submenu" id="sub4">
                                <input name="facials1" type="checkbox" id="facials1" value="Anti-Aging Facial">Anti-Aging Facial<br>
                                                <input name="facials2" type="checkbox" id="facials2" value="Aromatherapy Facial">Aromatherapy Facial<br>
                                                <input name="facials3" type="checkbox" id="facials3" value="Exfoliating Facial">Exfoliating Facial<br>
                                                <input name="facials4" type="checkbox" id="facials4" value="Gentlemen Basic Facial">Gentlemen’s Facial<br>
                                <input name="facials5" type="checkbox" id="facials5" value="Gentlemen Intensive Facial">Executive's Facial<br>
                                                <input name="facials6" type="checkbox" id="facials6" value="Hydrating Facial">Hydrating Facial<br>
                                                <input name="facials7" type="checkbox" id="facials7" value="Lacto-Peel Facial">Lacto-Peel/Medicalia<br>
                                                <input name="facials8" type="checkbox" id="facials8" value="OilControl Facial">Oil Control Facial<br>
                                                <input name="facials9" type="checkbox" id="facials9" value="DeepCleansing Facial">OSIRIS Customized Deep Cleansing Facial<br>
                                <input name="facials10" type="checkbox" id="facials10" value="OSIRISIntensive Facial">OSIRIS “Intensive” Facial<br>
                                                <input name="facials11" type="checkbox" id="facials11" value="O2ptimal Facial">O2ptimal Sensitive Skin Facial<br>
                                                <input name="facials12" type="checkbox" id="facials12" value="Rejuvenating Facial">Rejuvenating Facial<br>
                                <input name="facials13" type="checkbox" id="facials13" value="Rosacea Facial">Rosacea Relief Facial<br>
                                <input name="facials14" type="checkbox" id="facials14" value="SkinLightening Facial">Skin Lightening Facial<br>
                                <input name="facials15" type="checkbox" id="facials15" value="Teen Facial">Teen Deep Pore Cleansing Facial<br>
                                <input name="facials16" type="checkbox" id="facials16" value="VitaminC Facial">Vitamin C Enriching Facial<br>
                                </span>
                                                <div class="mainmenu" onclick="SwitchMenu('sub5')">Eyes and Lips</div>
                                <span class="submenu" id="sub5">
                                <input name="eyeslips1" type="checkbox" id="eyeslips1" value="Eye Puffiness Treatment">De-Stress Eye Puffiness**<br>
                                <input name="eyeslips2" type="checkbox" id="eyeslips2" value="Eye Wrinkles Treatment">De-Stress Eye Wrinkles**<br>
                                <input name="eyeslips3" type="checkbox" id="eyeslips3" value="Eye Enhancement Treatment">Eye Enhancement Treatment<br>
                                                <input name="eyeslips4" type="checkbox" id="eyeslips4" value="Lip Enhancement Treatment">Lip Enhancement Treatment**<br>
                                </span>
                                                <div class="mainmenu" onclick="SwitchMenu('sub6')">Hands and Feet</div>
                                <span class="submenu" id="sub6">
                                <input name="handsfeet1" type="checkbox" id="handsfeet1" value="Lightening Hand Treatment w/Manicure">Lightening Hand Treatment with Manicure<br>
                                <input name="handsfeet2" type="checkbox" id="handsfeet2" value="Moor Relief for Hands and Feet">Moor Relief For Your Hands and Feet<br>
                                <input name="handsfeet3" type="checkbox" id="handsfeet3" value="OSIRIS Manicure">OSIRIS Signature Manicure<br>
                                                <input name="handsfeet4" type="checkbox" id="handsfeet4" value="OSIRIS Pedicure">OSIRIS Signature Pedicure<br>
                                                <input name="handsfeet5" type="checkbox" id="handsfeet5" value="Regenerating Hand Treatment w/Manicure">Regenerating Hand Treatment With Manicure<br>
                                                <input name="handsfeet6" type="checkbox" id="handsfeet6" value="The Perfect Manicure/Pedicure">The Perfect Manicure/Pedicure<br>
                                </span>
                                                <div class="mainmenu" onclick="SwitchMenu('sub7')">Body Waxing</div>
                                <span class="submenu" id="sub7">
                                <input name="waxing1" type="checkbox" id="waxing1" value="Arm Wax">Arms, Full<br>
                                                <input name="waxing2" type="checkbox" id="waxing2" value="Half Arm Wax">Arms, Half<br>
                                                <input name="waxing3" type="checkbox" id="waxing3" value="Back Wax">Back<br>
                                                <input name="waxing4" type="checkbox" id="waxing4" value="Bikini Wax">Bikini Line<br>
                                                <input name="waxing5" type="checkbox" id="waxing5" value="Chest Wax">Chest<br>
                                                <input name="waxing6" type="checkbox" id="waxing6" value="Chin Wax">Chin<br>
                                                <input name="waxing7" type="checkbox" id="waxing7" value="Eyebrows Wax">Eyebrows<br>
                                                <input name="waxing8" type="checkbox" id="waxing8" value="Leg/Bikini Wax">Full Leg and Bikini<br>
                                <input name="waxing9" type="checkbox" id="waxing9" value="Leg Wax">Legs, Full<br>
                                <input name="waxing10" type="checkbox" id="waxing10" value="Half Leg Wax">Legs, Half<br>
                                <input name="waxing11" type="checkbox" id="waxing11" value="Sideburns Wax">Sideburns<br>
                                <input name="waxing12" type="checkbox" id="waxing12" value="Underarm Wax">Underarm<br>
                                                <input name="waxing13" type="checkbox" id="waxing13" value="Lip Wax">Upper Lip<br>
                                </span>
                                                <div class="mainmenu" onclick="SwitchMenu('sub8')">Spa Packages</div>
                                <span class="submenu" id="sub8">
                                <input name="spa1" type="checkbox" id="spa1" value="Candlelight for Couples">Candlelight for Couples<br>
                                                <input name="spa2" type="checkbox" id="spa2" value="Mummy's Reward">Mummy’s Reward<br>
                                                <input name="spa3" type="checkbox" id="spa3" value="Petite Pampering">Petite Pampering<br>
                                                <input name="spa4" type="checkbox" id="spa4" value="Royal Renewal">Royal Renewal<br>
                                <input name="spa5" type="checkbox" id="spa5" value="Teen Surprise">Teen Surprise<br>
                                <input name="spa6" type="checkbox" id="spa6" value="Ultimate Indulgence">The Ultimate Indulgence<br>
                               
                                </span>
                                                <div class="mainmenu" onclick="SwitchMenu('sub9')">Bridal Packages</div>
                                <span class="submenu" id="sub9">
                                <input name="bridal1" type="checkbox" id="bridal1" value="Bride Package">Beautiful Bride<br>
                                <input name="bridal2" type="checkbox" id="bridal2" value="Groom Package">Grooming the Groom<br>
                                </span>
                                                <div class="mainmenu" onclick="SwitchMenu('sub10')">Customized Packages and Wellness Services</div>
                                <span class="submenu" id="sub10">
                                                <input name="other1" type="checkbox" id="other1" value="Custom Services Requested">Customize Your Package: Add comments below<br>
                                              <input name="other2" type="checkbox" id="other2" value="Yoga Class">Hatha Yoga Class<br>
                                <input name="other3" type="checkbox" id="other3" value="T'ai Chi Class">T’ai Chi Ch’uan Class<br>
                                <input name="other4" type="checkbox" id="other4" value="Nutrition Services Requested">Nutritional Services: Add comments below<br>
                                                </span>
                                          </div></td> <!--end master div and services table cell -->
                          </tr>
                          <tr valign="top">
                            <td width="125" valign="top" class="smblack"><strong>Add-on service(s): </strong><BR>
                            Add as a complement<BR>to a massage or<BR>alternative therapy.</td>
                            <td width="350" class="bodytext">  <input name="reflex_30" type="checkbox" id="reflex_30" value="Reflex 30-minute Session">
                              30-Minute Reflexology Session<br>
                              <input name="energy_30" type="checkbox" id="energy_30" value="Energy 30-minute Session">
                            30-Minute Energy Healing Session  </td>
                          </tr>
                          <tr valign="top">
                            <td valign="top" class="smblack">&nbsp;</td>
                            <td class="bodytext"><strong class="bodytext"><em>Eyes
                                  &amp; Lips services marked ** are not standalone
                                  services. They may be purchased jointly with
                                  another eye or lip treatment or as a complement
                                  to an OSIRIS facial, body treatment and/or
                                  body waxing service.</em></strong></td>
                          </tr>
                         <!-- <tr valign="top">
                            <td width="112" class="subtitle">&nbsp;</td>
                            <td class="subtitle">&nbsp;</td>
                          </tr> -->
                          <!-- copied calendar code starts here -->
                          <tr>
                            <td colspan="3" height="26"> <p align="left" class="smblack"><strong>
                                What is the best time for you to come in for your
                                appointment?</strong></p></td>
                          </tr>
                          <tr>
                            <td height="21" colspan="3"> <p style="margin-top: 0; margin-bottom: 0"><i>
                                <font face="Verdana" color="#808080" style="font-size: 8pt">...choose
                                the best day of the week for you to come...</font></i></td>
                          </tr>
                          <tr>
                            <td width="125" height="22"> <p class="smblack"><strong>1st
                            Appt Choice: </strong></p></td>
                            <td height="22" colspan="2"> <p style="margin-top: 0; margin-bottom: 0">
                                <font color="#808080" face="Verdana" style="font-size: 8pt">Day-
                                <select size="1" name="day1" class="smblack">
                                  <option>Wednesday</option>
                                  <option>Thursday</option>
                                  <option>Friday</option>
                                  <option>Saturday</option>
                                </select>
                                &nbsp;</font> <font color="#808080" face="Verdana" style="font-size: 8pt">Time-
                                <select size="1" name="time1" class="smblack">
                                  <option>Earliest Time Possible</option>
                                  <option>Latest Time Possible</option>
                                  <option>Morning</option>
                                  <option>Afternoon</option>
                                  <option>Evening (Before 7:00)</option>
                                  <option>9 AM</option>
                                  <option>10 AM</option>
                                  <option>11 AM</option>
                                  <option>12 PM</option>
                                  <option>1 PM</option>
                                  <option>2 PM</option>
                                  <option>3 PM</option>
                                  <option>4 PM</option>
                                  <option>5 PM</option>
                                  <option>6 PM</option>
                                  <option>7 PM</option>
                                </select>
                                &nbsp;</font> </td>
                          </tr>
                          <tr>
                            <td width="125" height="22"> <p class="smblack"><strong>2nd
                            Appt Choice: </strong></p></td>
                            <td height="22" colspan="2"> <p style="margin-top: 0; margin-bottom: 0">
                                <font color="#808080" face="Verdana" style="font-size: 8pt">Day-
                                <select size="1" name="day2" class="smblack">
                                  <option>Wednesday</option>
                                  <option>Thursday</option>
                                  <option>Friday</option>
                                  <option>Saturday</option>
                                </select>
                                &nbsp;</font> <font color="#808080" face="Verdana" style="font-size: 8pt">Time-
                                <select size="1" name="time2" class="smblack">
                                  <option>Earliest Time Possible</option>
                                  <option>Latest Time Possible</option>
                                  <option>Morning</option>
                                  <option>Afternoon</option>
                                  <option>Evening (Before 7:00)</option>
                                  <option>9 AM</option>
                                  <option>10 AM</option>
                                  <option>11 AM</option>
                                  <option>12 PM</option>
                                  <option>1 PM</option>
                                  <option>2 PM</option>
                                  <option>3 PM</option>
                                  <option>4 PM</option>
                                  <option>5 PM</option>
                                  <option>6 PM</option>
                                  <option>7 PM</option>
                                </select>
                                &nbsp;</font> </td>
                          </tr>
                          <tr>
                            <td height="21" colspan="3"> <p style="margin-top: 0; margin-bottom: 0"><i>
                                <font face="Verdana" color="#808080" style="font-size: 8pt">...or
                                choose the date you would like to come...</font></i></td>
                          </tr>
                          <tr>
                            <td width="125" height="22"> <p class="smblack"><strong>1st
                            Appt Choice: </strong></p></td>
                            <td height="22" colspan="2"> <p style="margin-top: 0; margin-bottom: 0">
                                <font color="#808080" face="Verdana" style="font-size: 8pt">Month-
                                <select size="1" name="month1" class="smblack">
                                  <option>n/a</option>
                                  <option>January</option>
                                  <option>February</option>
                                  <option>March</option>
                                  <option>April</option>
                                  <option>May</option>
                                  <option>June</option>
                                  <option>July</option>
                                  <option>August</option>
                                  <option>September</option>
                                  <option>October</option>
                                  <option>November</option>
                                  <option>December</option>
                                </select>
                                </font> <font color="#808080" face="Verdana" style="font-size: 8pt">Day-
                                <select size="1" name="date1" class="smblack">
                                  <option>n/a</option>
                                  <option>1</option>
                                  <option>2</option>
                                  <option>3</option>
                                  <option>4</option>
                                  <option>5</option>
                                  <option>6</option>
                                  <option>7</option>
                                  <option>8</option>
                                  <option>9</option>
                                  <option>10</option>
                                  <option>11</option>
                                  <option>12</option>
                                  <option>13</option>
                                  <option>14</option>
                                  <option>15</option>
                                  <option>16</option>
                                  <option>17</option>
                                  <option>18</option>
                                  <option>19</option>
                                  <option>20</option>
                                  <option>21</option>
                                  <option>22</option>
                                  <option>23</option>
                                  <option>24</option>
                                  <option>25</option>
                                  <option>26</option>
                                  <option>27</option>
                                  <option>28</option>
                                  <option>29</option>
                                  <option>30</option>
                                  <option>31</option>
                                </select>
                                </font> </td>
                          </tr>
                          <tr>
                            <td width="125" height="22"> <p class="smblack"><strong>2nd
                            Appt Choice: </strong></p></td>
                            <td height="22" colspan="2"> <p style="margin-top: 0; margin-bottom: 0">
                                <font color="#808080" face="Verdana" style="font-size: 8pt">Month-
                                <select size="1" name="month2" class="smblack">
                                  <option>n/a</option>
                                  <option>January</option>
                                  <option>February</option>
                                  <option>March</option>
                                  <option>April</option>
                                  <option>May</option>
                                  <option>June</option>
                                  <option>July</option>
                                  <option>August</option>
                                  <option>September</option>
                                  <option>October</option>
                                  <option>November</option>
                                  <option>December</option>
                                </select>
                                </font> <font color="#808080" face="Verdana" style="font-size: 8pt">Day-
                                <select size="1" name="date2" class="smblack">
                                  <option>n/a</option>
                                  <option>1</option>
                                  <option>2</option>
                                  <option>3</option>
                                  <option>4</option>
                                  <option>5</option>
                                  <option>6</option>
                                  <option>7</option>
                                  <option>8</option>
                                  <option>9</option>
                                  <option>10</option>
                                  <option>11</option>
                                  <option>12</option>
                                  <option>13</option>
                                  <option>14</option>
                                  <option>15</option>
                                  <option>16</option>
                                  <option>17</option>
                                  <option>18</option>
                                  <option>19</option>
                                  <option>20</option>
                                  <option>21</option>
                                  <option>22</option>
                                  <option>23</option>
                                  <option>24</option>
                                  <option>25</option>
                                  <option>26</option>
                                  <option>27</option>
                                  <option>28</option>
                                  <option>29</option>
                                  <option>30</option>
                                  <option>31</option>
                                </select>
                                </font> </td>
                          </tr>
                          <tr valign="top">
                            <td width="125" class="subtitle"><p class="smblack"><font face="Verdana">Co</font>mments/Questions:</p></td>
                            <td width="350" class="subtitle"><textarea name="comments" cols="30" rows="6" wrap="PHYSICAL" class="bodytext"></textarea></td>
                          </tr>
                        </table>
                        <table width="100%" border="0" cellpadding="0">
                          <tr>
                            <td colspan="2" class="subtitle">&nbsp;</td>
                          </tr>
                          <tr>
                            <td colspan="2" class="subtitle"></td>
                          </tr>
                          <tr>
                            <td width="79%" class="subtitle">&nbsp; </td>
                            <td width="21%" class="subtitle"><input name="Send" type="submit" id="Send" value="Send" /></td>
                          </tr>
                        </table>
                      </div>
                    </form></td>
                  <td rowspan="2"><img name="column_spacer4" src="../images/column_spacer4.gif" width="9" height="318" border="0" alt=""></td>
                  <td rowspan="2"><img src="../images/spacer.gif" width="1" height="100%" border="0" alt=""></td>
                </tr>
                <tr>
                  <td colspan="9"  valign="top">&nbsp;</td>
                </tr>
                <tr>
                  <!-- row 10 -->
                  <td><img name="footer_left" src="../images/footer_left.gif" width="10" height="24" border="0" alt=""></td>
                  <td colspan="2"><a href="javascript:popupPrice('../price_list/price_list.html');" onMouseOut="MM_swapImgRestore();" onMouseOver="MM_swapImage('service_menu','','../images/service_menu_f2.gif',1)"><img name="service_menu" src="../images/service_menu.gif" width="79" height="24" border="0" alt="Menu of Sevices"></a></td>
                  <td><img name="footer_spacer1" src="../images/footer_spacer1.gif" width="9" height="24" border="0" alt=""></td>
                  <td colspan="3"><a href="appt_request_form.html" target="_self" onMouseOut="MM_swapImgRestore();" onMouseOver="MM_swapImage('appointment','','../images/appointment_f2.gif',1)"><img name="appointment" src="../images/appointment.gif" width="113" height="24" border="0" alt="Request An Appointment"></a></td>
                  <td colspan="2"><img name="footer_spacer2" src="../images/footer_spacer2.gif" width="17" height="24" border="0" alt=""></td>
                  <td colspan="3"><a href="../calendar/index.html" target="_self" onMouseOut="MM_swapImgRestore();" onMouseOver="MM_swapImage('calendar','','../images/calendar_f2.gif',1)"><img name="calendar" src="../images/calendar.gif" width="83" height="24" border="0" alt="Events Calendar"></a></td>
                  <td><img name="footer_spacer3" src="../images/footer_spacer3.gif" width="13" height="24" border="0" alt=""></td>
                  <td colspan="3"><a href="../about/legal.html" target="_self" onMouseOut="MM_swapImgRestore();" onMouseOver="MM_swapImage('terms','','../images/terms_f2.gif',1)"><img name="terms" src="../images/terms.gif" width="100" height="24" border="0" alt="Terms and Conditions"></a></td>
                  <td><img name="footer_spacer4" src="../images/footer_spacer4.gif" width="11" height="24" border="0" alt=""></td>
                  <td colspan="5"><a href="mailto:info@osiriswellness.com" target="_self" onMouseOver="MM_swapImage('contact','','../images/contact_f2.gif',1)" onMouseOut="MM_swapImgRestore()"><img name="contact" src="../images/contact.gif" width="132" height="24" border="0" alt="Contact Us"></a></td>
                  <td colspan="5"><img name="footer_right" src="../images/footer_right.gif" width="182" height="24" border="0" alt="Copyright 2004 OSIRIS"></td>
                  <td><img src="../images/spacer.gif" width="1" height="24" border="0" alt=""></td>
                </tr>
                <tr>
                  <!-- row 11 -->
                  <td colspan="27"><img name="slice" src="../images/slice.gif" width="749" height="1" border="0" alt=""></td>
                  <td><img src="../images/spacer.gif" width="1" height="1" border="0" alt=""></td>
                </tr>
                <!--   This table was automatically created with Macromedia Fireworks   -->
                <!--   http://www.macromedia.com   -->
              </table></td>
          </tr>
        </table>
       
      </div></td>
    <td></td>
  </tr>
  <tr>
    <td></td>
    <td></td>
    <td></td>
  </tr>
</table>
</body>
</html>
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 25

Expert Comment

by:archrajan
ID: 13720567
Where can i see those checkboxes?
0
 

Author Comment

by:imuhlenkamp
ID: 13720608
beta.osiriswellness.com
click on appointment request
0
 
LVL 25

Expert Comment

by:archrajan
ID: 13720688
just change this line

function validateServices1(formdata)
to

function validateServices1(form)
0
 

Author Comment

by:imuhlenkamp
ID: 13720845
Thanks, archrajan, passing the 'form' argument cleared up the problem of the other error traps not working; but the validateServices1 still doesn't work.  If I check on of the boxes in group B and go back and check a box in group A,
the error message still appears (when it shouldn't).

Any ideas?
0
 
LVL 25

Expert Comment

by:archrajan
ID: 13720891
Ok..
For that can you provide me some more information:
what are the conditions which we need to check???(related to the checkboxes)
0
 

Author Comment

by:imuhlenkamp
ID: 13720925
If you check any Eyes & Lips service marked with an ** (eyeslips1, eyeslips2, or eyeslips4) then you MUST also check at least on Facial or Body Treatment or Waxing service.

I'm checking for this in the validateServices1(form) function.  Maybe I shouldn't have such a compound IF?
0
 
LVL 25

Expert Comment

by:archrajan
ID: 13721077
try this:
function validateServices1()  {
var form = document.form1
var cnt = 0;
if(form.eyeslips1.checked == true|| form.eyeslips2.checked== true || form.eyeslips4.checked== true)
{

var el = form.elements
for(i = 0; i <elements.length;i++)
{
if(el[i].type == 'checkbox' && (el[i].name.indexOf('body')!= -1 || el[i].name.indexOf('facials')!=-1 || el[i].name.indexOf('waxing')!= -1))
if(el[i].checked)
cnt++;

     
}
}

if(cnt == 0)
return false
}
0
 
LVL 25

Expert Comment

by:archrajan
ID: 13721240
Oops:
This one is much better:

function validateServices1()  {
var form = document.form1
var cnt = 0;

if(document.getElementById('eyeslips1').checked == true || document.getElementById('eyeslips2').checked == true || document.getElementById('eyeslips4').checked == true)
{

var el = form.elements
for(i = 0; i <el.length;i++)
{
if(el[i].type == 'checkbox' && (el[i].name.indexOf('body')!= -1 || el[i].name.indexOf('facials')!=-1 || el[i].name.indexOf('waxing')!= -1))

if(el[i].checked == true)
cnt++;

     
}

if(cnt == 0)
{
alert("Please make selections properly");
return false
}
}
}
0
 

Author Comment

by:imuhlenkamp
ID: 13721360
This is definitely on the right track, but not quite right.

I made a few modifications because if you don't check any of the eye/lip boxes (none are true), then the cnt is still 0 and you get the error message.  I changed the code to this, but I'm not getting an error
when I check eyelip1, 2, or 3 but nothing else--and I should.

I'll be back online in 2 hours.  Thanks, again, for your help.
***************************************************************************************************************************************
function validateServices1()  {
var form = document.form1;
var cnt = 0;
if(form.eyeslips1.checked == true|| form.eyeslips2.checked== true || form.eyeslips4.checked== true)
{
      var el = form.elements;
      for(i = 0; i <elements.length;i++)
      {
            if(el[i].type == 'checkbox' && (el[i].name.indexOf('body')!= -1 || el[i].name.indexOf('facials')!=-1 || el[i].name.indexOf('waxing')!= -1))
                  if(el[i].checked)
                        cnt++;
      }
      if(cnt == 0)
           return false;
      else
           return true;
}      //end if
else
      return true;
}      //end function
0
 
LVL 25

Accepted Solution

by:
archrajan earned 1600 total points
ID: 13721377
This one works perfectly:
function validateServices1()  {
var form = document.form1
var cnt = 0;

if(document.getElementById('eyeslips1').checked == true || document.getElementById('eyeslips2').checked == true || document.getElementById('eyeslips4').checked == true)
{

var el = form.elements
for(i = 0; i <el.length;i++)
{
if(el[i].type == 'checkbox' && (el[i].name.indexOf('body')!= -1 || el[i].name.indexOf('facials')!=-1 || el[i].name.indexOf('waxing')!= -1))

if(el[i].checked == true)
cnt++;

     
}

if(cnt == 0)
{
alert("Please make selections properly");
return false
}
}
}
0
 

Author Comment

by:imuhlenkamp
ID: 13722667
I do get an error message with this code, but it still allows the form to submit.  See the current form on beta.osiriswellness.com (appointment request).

I appreciate any other help you can provide.
0
 
LVL 31

Expert Comment

by:GwynforWeb
ID: 13722902
<script>
function validateForm(form){
 if  (!form.eyeslips1.checked && !form.eyeslips2.checked && !form.eyeslips4.checked) return true
 if  (form.eyeslips3.checked) return true

 elems=form.elements
 for (i=0;i<elems.length;i++)
  if (elems[i]!=form.eyeslips1 && elems[i]!=form.eyeslips1 && elems[i]!=form.eyeslips4)
     if (elems[i].type=='checkbox')
        if (/(body|waxing|facials)\d{1,2}/i.test(elems[i].id))
                if (elems[i].checked) return true
 
 return false
}

</script>
0
 
LVL 31

Assisted Solution

by:GwynforWeb
GwynforWeb earned 400 total points
ID: 13722909
typo

 <script>
function validateForm(form){
if  (!form.eyeslips1.checked && !form.eyeslips2.checked && !form.eyeslips4.checked) return true
if  (form.eyeslips3.checked) return true

elems=form.elements
for (i=0;i<elems.length;i++)
  if (elems[i]!=form.eyeslips1 && elems[i]!=form.eyeslips2 && elems[i]!=form.eyeslips4)
    if (elems[i].type=='checkbox')
       if (/(body|waxing|facials)\d{1,2}/i.test(elems[i].id))
                if (elems[i].checked) return true

 return false
}

</script>
0
 

Author Comment

by:imuhlenkamp
ID: 13723043
Thanks to you both.  GwynforWeb helped me find what was missing from the code I copied from archrajan to get the form to work the way I wanted it to.  archrajan's answer was the code that I used.

I appreciate the help and the quick response.
0
 
LVL 31

Expert Comment

by:GwynforWeb
ID: 13723177
thx for the points. :-)
0
 
LVL 25

Expert Comment

by:archrajan
ID: 13723182
Thanks for the points
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question