Solved

Selection of value in select will affect display option in another select

Posted on 2003-11-04
9
293 Views
Last Modified: 2006-11-17
Hi, I have the following code and would like the script to behave in such a way that when a user selects the month of June, for example, the number of days displayed would be 1 to 30, or that of July would be from 1 to 31, etc. Any help would be appreciated.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Member Registration</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="Styles/Definitions.css" rel="stylesheet" type="text/css">
</head>

<body topmargin="10" bottommargin="10" leftmargin="10" rightmargin="10">
<p class="Heading2">Membership Registration</p>
<p class="BodyTextNormal">The email address and password entered will be used to login to our web site. After which, registered members will be able to access our sample products, while paid registered members will be able to access pre-selected products.</p>
<p class="BodyTextNormal">Please enter your details below:</p>
<form method="post" name="formMembershipRegistration" action="http://somewhere/somefolder">
  <table width="480" border="0" cellspacing="0" cellpadding="0">
    <tr>
        <td colspan="2" class="TableTextBold">Title &amp; Name</td>
    </tr>
    <tr>
      <td width="160" class="TableTextNormal"><label for="labelTitle">Title:</label></td>
      <td width="320" class="TableTextNormal">
          <select name="selectTitle" id="labelTitle" size="1">
              <option value="NULL">Select Title</option>
          <option value="Mr">Mr</option>
          <option value="Mrs">Mrs</option>
          <option value="Mdm">Mdm</option>
          <option value="Ms">Ms</option>
          <option value="Dr">Dr</option>
          <option value="Prof">Prof</option>
        </select>
        </td>
    </tr>
    <tr>
        <td class="TableTextNormal"><label for="labelFirstName">First Name:</label></td>
      <td class="TableTextNormal"><input name="inputFirstName" type="text" id="labelFirstName" size="20" maxlength="30"></td>
    </tr>
      <tr>
        <td class="TableTextNormal"><label for="labelMiddleName">Middle Name:</label></td>
      <td class="TableTextNormal"><input name="inputMiddleName" type="text" id="labelMiddleName" size="4" maxlength="6"></td>
    </tr>
    <tr>
        <td class="TableTextNormal"><label for="labelLastName">Last Name:</label></td>
      <td class="TableTextNormal"><input name="inputLastName" type="text" id="labelLastName" size="20" maxlength="30"></td>
    </tr>
    <tr>
        <td class="TableTextNormal" colspan="2">&nbsp;</td>
    </tr>
      <tr>
        <td class="TableTextBold" colspan="2">Email &amp; Password</td>
    </tr>
      <tr>
        <td class="TableTextNormal"><label for="labelEmailAddress">Email Address:</label></td>
      <td class="TableTextNormal"><input name="inputEmailAddress" type="text" id="labelEmailAddress" size="30" maxlength="40"></td>
    </tr>
    <tr>
        <td class="TableTextNormal"><label for="labelVerifyEmailAddress">Verify Email Address:</label></td>
      <td class="TableTextNormal"><input name="inputVerifyEmailAddress" type="text" id="labelVerifyEmailAddress" size="30" maxlength="40"></td>
    </tr>
      <tr>
        <td class="TableTextNormal"><label for="labelPassword">Password:</label></td>
      <td class="TableTextNormal"><input name="inputPassword" type="text" id="labelPassword" size="10" maxlength="15"></td>
    </tr>
      <tr>
        <td class="TableTextNormal"><label for="labelVerifyPassword">Verify Password:</label></td>
      <td class="TableTextNormal"><input name="inputVerifyPassword" type="text" id="labelVerifyPassword" size="10" maxlength="15"></td>
    </tr>
    <tr>
        <td class="TableTextNormal" colspan="2">&nbsp;</td>
    </tr>
      <tr>
        <td class="TableTextBold" colspan="2">Details</td>
    </tr>
      <tr>
        <td class="TableTextNormal"><label for="labelGender">Gender:</label></td>
      <td class="TableTextNormal">
          <input name="inputGender" type="radio" id="labelGender" value="M">
        Male
        <input name="inputGender" type="radio" id="labelGender" value="F">
        Female
        </td>
    </tr>
      <tr>
      <td class="TableTextNormal"><label for="labelMaritalStatus">Marital Status:</label></td>
      <td class="TableTextNormal">
          <select name="selectMaritalStatus" id="labelMaritalStatus" size="1">
              <option value="NULL">Select Status</option>
          <option value="S">Single</option>
          <option value="L">Live-In Partner</option>
          <option value="M">Married</option>
          <option value="D">Divorced</option>
        </select>
        </td>
    </tr>
      <tr>
        <td class="TableTextNormal"><label for="labelBirthDate">Date of Birth:</label></td>
      <td class="TableTextNormal">
        <select name="selectBirthMonth" id="labelBirthDate" size="1">
              <option value="NULL" onClick=<?php $BirthMonth = "NULL" ?>>Select Month</option>
              <option value="1" onClick=<?php $BirthMonth = 1 ?>>January</option>
              <option value="2" onClick=<?php $BirthMonth = 2 ?>>Febuary</option>
              <option value="3" onClick="<?php $BirthMonth = 3 ?>">March</option>
              <option value="4" onClick="<?php $BirthMonth = 4 ?>">April</option>
              <option value="5" onClick="<?php $BirthMonth = 5 ?>">May</option>
              <option value="6" onClick="<?php $BirthMonth = 6 ?>">June</option>
              <option value="7" onClick="<?php $BirthMonth = 7 ?>">July</option>
              <option value="8" onClick="<?php $BirthMonth = 8 ?>">August</option>
              <option value="9" onClick="<?php $BirthMonth = 9 ?>">September</option>
              <option value="10" onClick="<?php $BirthMonth = 10 ?>">Octobre</option>
              <option value="11" onClick="<?php $BirthMonth = 11 ?>">November</option>
              <option value="12" onClick="<?php $BirthMonth = 12 ?>">December</option>
            </select>
          <select name="selectBirthDay" id="labelBirthDate" size="1">
              <option value="NULL">Select Day</option>
              <?php
                switch ($BirthMonth)
                  {
                    case 1:
                  $day = 1;
                    while ($day <= 31)
                    {
            ?>
              <option <?php print ("value=\"$day\""); ?>>
              <?php
                    print ("$day");
                      $day++;
              }
                    break;
              ?>
              </option>
              <?php
                    case 2:
                    $day = 1;
                    while ($day <= 29)
                    {
            ?>
              <option <?php print ("value=\"$day\""); ?>>
              <?php
                print ("$day");
                      $day++;
              }
                    break;
                  }
              ?>
              </option>
        </select>
        <select name="selectBirthYear" id="labelBirthDate" size="1">
              <option value="NULL">Select Year</option>
              <?php
                $year = 1900;
                  while ($year <= 2003)
                  {
            ?>
              <option>
              <?php
                  print ("$year");
                    $year++;
            }
              ?>
              </option>
            </select>
        </td>
    </tr>
      <tr>
        <td class="TableTextNormal"><label for="labelOccupation">Occupation:</label></td>
      <td class="TableTextNormal"><input name="inputOccupation" type="text" id="labelOccupation" size="30" maxlength="40"></td>
    </tr>
    <tr>
        <td class="TableTextNormal" colspan="2">&nbsp;</td>
    </tr>
      <tr>
        <td class="TableTextBold" colspan="2">Address</td>
    </tr>
      <tr>
        <td class="TableTextNormal"><label for="labelAddress1">Address:</label></td>
      <td class="TableTextNormal"><input name="inputAddress1" type="text" id="labelAddress1" size="35" maxlength="50"></td>
    </tr>
      <tr>
        <td class="TableTextNormal"><label for="labelAddress2">Address (Continued):</label></td>
      <td class="TableTextNormal"><input name="inputAddress2" type="text" id="labelAddress2" size="35" maxlength="50"></td>
    </tr>
      <tr>
        <td class="TableTextNormal"><label for="labelStateRegion">State/Region:</label></td>
      <td class="TableTextNormal"><input name="inputStateRegion" type="text" id="labelStateRegion" size="30" maxlength="40"></td>
    </tr>
      <tr>
        <td class="TableTextNormal"><label for="labelCity">City:</label></td>
      <td class="TableTextNormal"><input name="inputCity" type="text" id="labelCity" size="30" maxlength="40"></td>
    </tr>
      <tr>
        <td class="TableTextNormal"><label for="labelCountry">Country:</label></td>
      <td class="TableTextNormal"><input name="inputCountry" type="text" id="labelCountry" size="30" maxlength="40"></td>
    </tr>
      <tr>
        <td class="TableTextNormal"><label for="labelPostalCode">Postal Code:</label></td>
      <td class="TableTextNormal"><input name="inputPostalCode" type="text" id="labelPostalCode" size="6" maxlength="8"></td>
    </tr>
  </table>
  <p>
    <input type="submit" name="Submit" value="Submit">
    <input type="reset" name="Reset" value="Reset">
  </p>
</form>
</body>
</html>
0
Comment
Question by:mapledrums
  • 5
  • 2
  • 2
9 Comments
 
LVL 5

Author Comment

by:mapledrums
Comment Utility
The above is not a working version. The following is a version that works. I just want to provide more control over the data entry.

<html>
<head>
<title>Membership Registration</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="Styles/Definitions.css" rel="stylesheet" type="text/css">
</head>

<body topmargin="10" bottommargin="10" leftmargin="10" rightmargin="10">
<p class="Heading2">Membership Registration</p>
<p class="BodyTextNormal">The email address and password entered will be used to login to our web site. After which, registered members will be able to access our sample products, while paid registered members will be able to access pre-selected products.</p>
<p class="BodyTextNormal">Please enter your details below:</p>
<form method="post" name="formMembershipRegistration" action="http://somehost/prog">
  <fieldset>
    <legend class="Heading1">Title &amp; Name</legend>
    <table width="480" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="160" class="TableTextNormal"><label for="labelTitle">Title:</label></td>
        <td width="320" class="TableTextNormal">
            <select name="selectTitle" id="labelTitle" size="1">
                <option value="NULL">Select Title</option>
            <option value="Mr">Mr</option>
            <option value="Mrs">Mrs</option>
            <option value="Mdm">Mdm</option>
            <option value="Ms">Ms</option>
            <option value="Dr">Dr</option>
            <option value="Prof">Prof</option>
          </select>
          </td>
      </tr>
      <tr>
          <td class="TableTextNormal"><label for="labelFirstName">First Name:</label></td>
        <td class="TableTextNormal"><input name="inputFirstName" type="text" id="labelFirstName" size="20" maxlength="30"></td>
      </tr>
        <tr>
          <td class="TableTextNormal"><label for="labelMiddleName">Middle Name:</label></td>
        <td class="TableTextNormal"><input name="inputMiddleName" type="text" id="labelMiddleName" size="4" maxlength="6"></td>
      </tr>
      <tr>
          <td class="TableTextNormal"><label for="labelLastName">Last Name:</label></td>
        <td class="TableTextNormal"><input name="inputLastName" type="text" id="labelLastName" size="20" maxlength="30"></td>
      </tr>
    </table>
  </fieldset>
  <fieldset>
    <legend class="Heading1">Email & Password</legend>
    <table width="480" border="0" cellspacing="0" cellpadding="0">
      <tr>
          <td class="TableTextNormal"><label for="labelEmailAddress">Email Address:</label></td>
        <td class="TableTextNormal"><input name="inputEmailAddress" type="text" id="labelEmailAddress" size="30" maxlength="40"></td>
      </tr>
      <tr>
        <td class="TableTextNormal"><label for="labelVerifyEmailAddress">Verify Email Address:</label></td>
        <td class="TableTextNormal"><input name="inputVerifyEmailAddress" type="text" id="labelVerifyEmailAddress" size="30" maxlength="40"></td>
      </tr>
        <tr>
          <td class="TableTextNormal"><label for="labelPassword">Password:</label></td>
        <td class="TableTextNormal"><input name="inputPassword" type="text" id="labelPassword" size="10" maxlength="15"></td>
      </tr>
        <tr>
          <td class="TableTextNormal"><label for="labelVerifyPassword">Verify Password:</label></td>
        <td class="TableTextNormal"><input name="inputVerifyPassword" type="text" id="labelVerifyPassword" size="10" maxlength="15"></td>
      </tr>
    </table>
  </fieldset>
  <fieldset>
    <legend class="Heading1">Details</legend>
    <table width="480" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td class="TableTextNormal"><label for="labelGender">Gender:</label></td>
        <td class="TableTextNormal">
            <input name="inputGender" type="radio" id="labelGender" value="Male">Male
          <input name="inputGender" type="radio" id="labelGender" value="Female">Female
        </td>
      </tr>
        <tr>
        <td class="TableTextNormal"><label for="labelMaritalStatus">Marital Status:</label></td>
        <td class="TableTextNormal">
            <select name="selectMaritalStatus" id="labelMaritalStatus" size="1">
                <option value="NULL">Select Status</option>
            <option value="S">Single</option>
            <option value="L">Live-In Partner</option>
            <option value="M">Married</option>
            <option value="D">Divorced</option>
          </select>
        </td>
      </tr>
        <tr>
          <td class="TableTextNormal"><label for="labelBirthDate">Date of Birth:</label></td>
        <td class="TableTextNormal">
          <select name="selectBirthMonth" id="labelBirthDate" size="1">
            <option value="NULL">Select Month</option>
            <option value="1">January</option>
            <option value="2">Febuary</option>
            <option value="3">March</option>
            <option value="4">April</option>
            <option value="5">May</option>
            <option value="6">June</option>
            <option value="7">July</option>
            <option value="8">August</option>
            <option value="9">September</option>
            <option value="10">Octobre</option>
            <option value="11">November</option>
            <option value="12">December</option>
          </select>
          <select name="selectBirthDay" id="labelBirthDate" size="1">
            <option value="NULL">Select Day</option>
            <?php
              $day = 1;
              while ($day <= 31)
              {
              ?>
                <option <?php print ("value=\"$day\""); ?>>
                <?php
                print ("$day");
                $day++;
              }
                ?>
            </option>
          </select>
          <select name="selectBirthYear" id="labelBirthDate" size="1">
                <option value="NULL">Select Year</option>
                <?php
              $year = 1900;
              while ($year <= 2003)
              {
              ?>
            <option>
                <?php
                    print ("$year");
                $year++;
              }
                ?>
                </option>
          </select>
          </td>
      </tr>
      <tr>
          <td class="TableTextNormal"><label for="labelOccupation">Occupation:</label></td>
        <td class="TableTextNormal"><input name="inputOccupation" type="text" id="labelOccupation" size="30" maxlength="40"></td>
      </tr>
    </table>
  </fieldset>
  <fieldset>
    <legend class="Heading1">Address</legend>
    <table width="480" border="0" cellspacing="0" cellpadding="0">
      <tr>
          <td class="TableTextNormal"><label for="labelAddress1">Address:</label></td>
        <td class="TableTextNormal"><input name="inputAddress1" type="text" id="labelAddress1" size="35" maxlength="50"></td>
      </tr>
      <tr>
          <td class="TableTextNormal"><label for="labelAddress2">Address (Continued):</label></td>
        <td class="TableTextNormal"><input name="inputAddress2" type="text" id="labelAddress2" size="35" maxlength="50"></td>
      </tr>
        <tr>
          <td class="TableTextNormal"><label for="labelStateRegion">State/Region:</label></td>
        <td class="TableTextNormal"><input name="inputStateRegion" type="text" id="labelStateRegion" size="30" maxlength="40"></td>
      </tr>
        <tr>
          <td class="TableTextNormal"><label for="labelCity">City:</label></td>
        <td class="TableTextNormal"><input name="inputCity" type="text" id="labelCity" size="30" maxlength="40"></td>
      </tr>
      <tr>
          <td class="TableTextNormal"><label for="labelCountry">Country:</label></td>
        <td class="TableTextNormal"><input name="inputCountry" type="text" id="labelCountry" size="30" maxlength="40"></td>
      </tr>
        <tr>
          <td class="TableTextNormal"><label for="labelPostalCode">Postal Code:</label></td>
        <td class="TableTextNormal"><input name="inputPostalCode" type="text" id="labelPostalCode" size="6" maxlength="8"></td>
      </tr>
    </table>
  </fieldset>
  <p>
    <input type="submit" name="Submit" value="Submit">
    <input type="reset" name="Reset" value="Reset">
  </p>
</form>
</body>
</html>
0
 
LVL 8

Expert Comment

by:inq123
Comment Utility
Hi mapledrums,

You can do what you want in php, but a cleaner way would be to use JavaScript (even if you want to do it in php, you still need a bit of JS anyway).  Just make up a JS array storing days for each month, and make onChange function for the select for months, and in the JS handler for onChange, change the options in select for days.  There're plenty of examples on web for doing similar tasks

Cheers!
0
 
LVL 5

Author Comment

by:mapledrums
Comment Utility
Hi inq123, first off, i'm still quite new to programming & i've just picked up PHP about two weeks ago. At this point, I would rather just get the web page to work first. It would be nice if the page could be ported over to javascript as well, but java is something i've not picked up yet, so that'll come later.
0
 
LVL 5

Author Comment

by:mapledrums
Comment Utility
However, if you'll willing to help me port the program over to javascript according to what has been specified, i'll be willing to accept that as well.
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 3

Accepted Solution

by:
red010knight earned 300 total points
Comment Utility
PHP doesn't support client side interaction - it is strictly a servide side application. To do what you want using PHP would require you to have to refresh the page and pass all the variables along for the ride that were entered thus far which is a big coding nightmare.

Javascript is the easiest way to go for form control and validation, there are a number of scripts out there prewritten that just take minor editing and usually are documented enough to do what you want.

http://javascript.internet.com/calendars/date-picker.html  -- is a rather nice calendar script that will auto insert a date string for the user rather than you have several boxes to use for it - though it could be tedius for varying age users but it can be worked out once you get more familiar with the code.

OH- and this one does EXACTLY what you want --
http://javascript.internet.com/calendars/date-menu.html

Hope these help,
Red010Knight
0
 
LVL 8

Expert Comment

by:inq123
Comment Utility
redknight, nice find!  mapledrums, the datemenu javascript did the stuff I talked about and more, but I would suggest to improve the look by changing the lines

<select name=day>
<option>  </option>

to:

<select name=day onFocus="populate(this.form,this.form.month.selectedIndex);">
<option>1 </option>

It just looks better, and if you choose to have year and month be current year and month, this will prevent user click on day first and find an empty list.

0
 
LVL 5

Author Comment

by:mapledrums
Comment Utility
Thanks for the response. I'll have a look at the sample scripts & go through them.

Since what I require isn't efficient with PHP, I'll close off this question after I go though the Javascript samples. If I've got questions then, I'll post them up under Javascript. Thanks again.
0
 
LVL 5

Author Comment

by:mapledrums
Comment Utility
I've managed to port the whole darn thing to javascript. That was cool, now that particular web page doesn't have to depend on PHP or the server to run through the file. It also saves server processing cycles :)

Thanks a bunch for your help guys. I got the main date script from the same web site, but I used another example, closer to what I had in mind. In case anyone wants to have a look:

<html>
<head>
<title>Membership Signup</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="Styles/Definitions.css" rel="stylesheet" type="text/css">
<script language="JavaScript" type="text/JavaScript">
<!--
Now = new Date();
NowYear = Now.getYear();
if (NowYear < 2000) NowYear += 1900; //for Netscape

function DaysInMonth(WhichMonth, WhichYear)
{
  var DaysInMonth = 31;
 
  if (WhichMonth == "April" || WhichMonth == "June" || WhichMonth == "September" || WhichMonth == "November")
    DaysInMonth = 30;
 
  if (WhichMonth == "Febuary" && (WhichYear/4) != Math.floor(WhichYear/4))
    DaysInMonth = 28;
 
  if (WhichMonth == "Febuary" && (WhichYear/4) == Math.floor(WhichYear/4))
    DaysInMonth = 29;
 
  return DaysInMonth;
}

function ChangeOptionDays(Which)
{
  DaysObject = eval("document.formMembershipSignup." + Which + "Day");
  MonthObject = eval("document.formMembershipSignup." + Which + "Month");
  YearObject = eval("document.formMembershipSignup." + Which + "Year");

  Month = MonthObject[MonthObject.selectedIndex].text;
  Year = YearObject[YearObject.selectedIndex].text;

  DaysForThisSelection = DaysInMonth(Month, Year);
  CurrentDaysInSelection = DaysObject.length;
 
  if (CurrentDaysInSelection > DaysForThisSelection)
  {
    for (i=0; i<(CurrentDaysInSelection-DaysForThisSelection); i++)
    {
      DaysObject.options[DaysObject.options.length - 1] = null
    }
  }
 
  if (DaysForThisSelection > CurrentDaysInSelection)
  {
    for (i=0; i<(DaysForThisSelection-CurrentDaysInSelection); i++)
    {
      NewOption = new Option(DaysObject.options.length + 1);
      DaysObject.add(NewOption);
    }
  }
 
  if (DaysObject.selectedIndex < 0) DaysObject.selectedIndex == 0;
}

function WriteYearOptions()
{
  line = "";
 
  for (i=1900; i<=NowYear; i++)
  {
    line += "<option>";
    line += i;
      line += "</option>";
  }
 
  return line;
}

function verify()
{
  var errormessage = "You are required to complete the following fields: ";
  var passwordmessage = "The passwords do not match.";
  var emailmessage = "The E-mail addresses do not match.";
 
  if (document.formMembershipSignup.inputFirstName.value == "")
  {
    errormessage = errormessage + " - First Name";
  }
 
  if (document.formMembershipSignup.inputLastName.value=="")
  {
    errormessage = errormessage + " -  Last Name";
  }
 
  if (document.formMembershipSignup.inputEmailAddress.value=="")
  {
    errormessage = errormessage + " -  E-mail Address";
  }
 
  if (errormessage == "You are required to complete the following fields: ")
  {
    document.formMembershipSignup.submit();
  }
  else
    {
      alert(errormessage);
      return false;
    }
}

//-->
</script>
</head>

<body topmargin="10" bottommargin="10" leftmargin="10" rightmargin="10">
<p class="Heading2">Membership Signup</p>
<p class="BodyTextNormal">The email address and password entered will be used to login to our web site. After which, registered members will be able to access our sample products, while paid registered members will be able to access pre-selected products.</p>
<p class="BodyTextNormal">Please enter your details below:</p>
<form method="post" name="formMembershipSignup" enctype="multipart/form-data" action="http://tricia.aitt.biz/mec/MembershipSignup.htm">
  <div align="left">
    <fieldset class="FormFieldset">
      <legend class="Heading1">Title &amp; Name</legend>
      <table class="FormTable">
        <tr>
          <td width="160" class="TableTextNormal"><label for="labelTitle">Title:</label></td>
          <td class="TableTextNormal">
              <select name="selectTitle" id="labelTitle" size="1">
                  <option value="NULL">Select Title</option>
              <option value="Mr">Mr</option>
              <option value="Mrs">Mrs</option>
              <option value="Mdm">Mdm</option>
              <option value="Ms">Ms</option>
              <option value="Dr">Dr</option>
              <option value="Prof">Prof</option>
            </select>
          </td>
        </tr>
        <tr>
            <td class="TableTextNormal"><label for="labelFirstName">First Name:</label></td>
          <td class="TableTextNormal"><input name="inputFirstName" type="text" id="labelFirstName" size="20" maxlength="30"></td>
        </tr>
        <tr>
            <td class="TableTextNormal"><label for="labelMiddleName">Middle Name:</label></td>
          <td class="TableTextNormal"><input name="inputMiddleName" type="text" id="labelMiddleName" size="4" maxlength="6"></td>
        </tr>
        <tr>
            <td class="TableTextNormal"><label for="labelLastName">Last Name:</label></td>
          <td class="TableTextNormal"><input name="inputLastName" type="text" id="labelLastName" size="20" maxlength="30"></td>
        </tr>
      </table>
    </fieldset>
  </div>
  <div align="left">
    <fieldset class="FormFieldset">
      <legend class="Heading1">Email & Password</legend>
      <table class="FormTable">
        <tr>
            <td class="TableTextNormal" width="160"><label for="labelEmailAddress">E-mail Address:</label></td>
          <td class="TableTextNormal"><input name="inputEmailAddress" type="text" id="labelEmailAddress" size="30" maxlength="40"></td>
        </tr>
        <tr>
          <td class="TableTextNormal"><label for="labelVerifyEmailAddress">Verify E-mail Address:</label></td>
          <td class="TableTextNormal"><input name="inputVerifyEmailAddress" type="text" id="labelVerifyEmailAddress" size="30" maxlength="40"></td>
        </tr>
          <tr>
            <td class="TableTextNormal"><label for="labelPassword">Password:</label></td>
          <td class="TableTextNormal"><input name="inputPassword" type="password" id="labelPassword" size="10" maxlength="15"></td>
        </tr>
          <tr>
            <td class="TableTextNormal"><label for="labelVerifyPassword">Verify Password:</label></td>
          <td class="TableTextNormal"><input name="inputVerifyPassword" type="password" id="labelVerifyPassword" size="10" maxlength="15"></td>
        </tr>
      </table>
    </fieldset>
  </div>
  <div align="left">
    <fieldset class="FormFieldset">
      <legend class="Heading1">Details</legend>
      <table class="FormTable">
        <tr>
            <td class="TableTextNormal" width="160"><label for="labelGender">Gender:</label></td>
          <td class="TableTextNormal">
              <input name="inputGender" type="radio" id="labelGender" value="Male">Male
            <input name="inputGender" type="radio" id="labelGender" value="Female">Female
          </td>
        </tr>
          <tr>
          <td class="TableTextNormal"><label for="labelMaritalStatus">Marital Status:</label></td>
          <td class="TableTextNormal">
              <select name="selectMaritalStatus" id="labelMaritalStatus" size="1">
              <option value="NULL">Select Status</option>
              <option value="S">Single</option>
              <option value="L">Live-In Partner</option>
              <option value="M">Married</option>
              <option value="D">Divorced</option>
            </select>
          </td>
        </tr>
          <tr>
            <td class="TableTextNormal"><label for="labelBirthDate">Date of Birth:</label></td>
          <td class="TableTextNormal">
            <select name="selectBirthYear" id="labelBirthDate" size="1" onChange="ChangeOptionDays('selectBirth')">
                  <option value="NULL">Select Year</option>
              <script language="JavaScript">
                document.write(WriteYearOptions());
              </script>
            </select>
            <select name="selectBirthMonth" id="labelBirthDate" size="1" onChange="ChangeOptionDays('selectBirth')">
              <option value="NULL">Select Month</option>
              <option value="1">January</option>
              <option value="2">Febuary</option>
              <option value="3">March</option>
              <option value="4">April</option>
              <option value="5">May</option>
              <option value="6">June</option>
              <option value="7">July</option>
              <option value="8">August</option>
              <option value="9">September</option>
              <option value="10">October</option>
              <option value="11">November</option>
              <option value="12">December</option>
            </select>
            <select name="selectBirthDay" id="labelBirthDate" size="1">
              <option value="1">1</option>
              <option value="2">2</option>
              <option value="3">3</option>
              <option value="4">4</option>
              <option value="5">5</option>
              <option value="6">6</option>
              <option value="7">7</option>
              <option value="8">8</option>
              <option value="9">9</option>
              <option value="10">10</option>
              <option value="11">11</option>
              <option value="12">12</option>
              <option value="13">13</option>
              <option value="14">14</option>
              <option value="15">15</option>
              <option value="16">16</option>
              <option value="17">17</option>
              <option value="18">18</option>
              <option value="19">19</option>
              <option value="20">20</option>
              <option value="21">21</option>
              <option value="22">22</option>
              <option value="23">23</option>
              <option value="24">24</option>
              <option value="25">25</option>
              <option value="26">26</option>
              <option value="27">27</option>
              <option value="28">28</option>
              <option value="29">29</option>
              <option value="30">30</option>
              <option value="31">31</option>
            </select>
            </td>
        </tr>
        <tr>
            <td class="TableTextNormal"><label for="labelOccupation">Occupation:</label></td>
          <td class="TableTextNormal"><input name="inputOccupation" type="text" id="labelOccupation" size="30" maxlength="40"></td>
        </tr>
      </table>
    </fieldset>
  </div>
  <div align="left">
    <fieldset class="FormFieldset">
      <legend class="Heading1">Address</legend>
      <table class="FormTable">
        <tr>
          <td class="TableTextNormal" width="160"><label for="labelAddress1">Address:</label></td>
          <td class="TableTextNormal"><input name="inputAddress1" type="text" id="labelAddress1" size="35" maxlength="50"></td>
        </tr>
        <tr>
            <td class="TableTextNormal"><label for="labelAddress2">Address (Continued):</label></td>
          <td class="TableTextNormal"><input name="inputAddress2" type="text" id="labelAddress2" size="35" maxlength="50"></td>
        </tr>
          <tr>
            <td class="TableTextNormal"><label for="labelStateRegion">State/Region:</label></td>
          <td class="TableTextNormal"><input name="inputStateRegion" type="text" id="labelStateRegion" size="30" maxlength="40"></td>
        </tr>
          <tr>
            <td class="TableTextNormal"><label for="labelCity">City:</label></td>
          <td class="TableTextNormal"><input name="inputCity" type="text" id="labelCity" size="30" maxlength="40"></td>
        </tr>
        <tr>
            <td class="TableTextNormal"><label for="labelCountry">Country:</label></td>
          <td class="TableTextNormal"><input name="inputCountry" type="text" id="labelCountry" size="30" maxlength="40"></td>
        </tr>
          <tr>
            <td class="TableTextNormal"><label for="labelPostalCode">Postal Code:</label></td>
          <td class="TableTextNormal"><input name="inputPostalCode" type="text" id="labelPostalCode" size="6" maxlength="8"></td>
        </tr>
      </table>
    </fieldset>
  </div>
  <p>
    <input type="button" name="inputSubmitForm" value="Submit Form" onClick="verify();">
    <input type="reset" name="inputClearForm" value="Clear Form">
  </p>
</form>
</body>
</html>
0
 
LVL 3

Expert Comment

by:red010knight
Comment Utility
Do not forget about Feburary and leap year checks on days as well!

Red010Knight
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Introduction Many web sites contain image galleries; a common design for these galleries includes a page with a collection of thumbnail images.  You can click on each of the thumbnail images to see the larger version of the image.  This is easily i…
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.

763 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now