Advertisement

06.27.2005 at 02:53AM PDT, ID: 21471612
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

5.4

Age Validation

Asked by berkeleymorgan in Active Server Pages (ASP)

Tags: , ,

Hi,

I have posted my code below:

Below I have various input boxes. Where i need help is, when a customer puts in their DOB in fields - dateStr1, monthStr1 and yearStr1.. then puts in their age in field - Ages, I need to validate that the age entered is correct, when the customer enters their age in the Ages field -  preferably I would like this to happen as soon as their age as been inputed and not on form submit, but this isn't a must. Please can anyone help.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>

     <head>
          <title></title>
         
<script language="JavaScript" type="text/javascript">

if(document.all && !document.getElementById) {
    document.getElementById = function(id) {
         return document.all[id];
    }
}

<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

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_setTextOfLayer(objName,x,newText) { //v4.01
  if ((obj=MM_findObj(objName))!=null) with (obj)
    if (document.layers) {document.write(unescape(newText)); document.close();}
    else innerHTML = unescape(newText);
}
//-->


</script>
          <style>
     #sub1, #sub2
     {
     position: absolute;
     left: 429px;
     visibility: show;
     z-index: 2;
     width: 176px;
     }
.style3 {
     font-size: 12px;
     font-family: Verdana, Arial, Helvetica, sans-serif;
}
.style4 {font-family: Verdana, Arial, Helvetica, sans-serif}
</style>

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

<!-- Begin
catnumber = 2
offset = 150
performOnchange = false
if (document.all) {
  docObj = "document.all."
  styleObj = ".style"
  } else {
  docObj = "document."
  styleObj = ""
}
function openselect(subcat) {
  popupselect = eval(docObj + subcat + styleObj)
  popupselect.visibility = "visible"
}
function closeselect(submenu,subcat){
  popupselect = eval(docObj + subcat + styleObj)
  if (submenu.selectedIndex != 0) {
    popupselect.visibility = "hidden"
    numchoice = submenu.selectedIndex
    choice = submenu[numchoice].value
    quoteForm.subcategory.value = choice
     CalcLivingCare()
    submenu.selectedIndex = 0
  }
}
function lock() {
  performOnchange = false
}
function unlock() {
  performOnchange = true
}
function CalcLivingCare() {

if (quoteForm.categoria.value == "ageover") {

    quoteForm.subcategory2.value = quoteForm.subcategory.value * (4/10)}

  else
{
    quoteForm.subcategory2.value = quoteForm.subcategory.value * (1/10)}


}

function selectSub(cat) {
  for (i=1; i <= catnumber; i++) {
    subcat = "sub" + i
    popupselect = eval(docObj + subcat + styleObj)
    popupselect.visibility = "hidden"
  }
  if (performOnchange == true) {
    letsopen = "sub" + cat.selectedIndex
    if (letsopen == "sub0") {
      alert("No category selected")
      choice = "- subcategory -"
      quoteForm.subcategory.value = choice
       quoteForm.subcategory2.value = choice
      cat.focus()
      } else {
      openselect(letsopen)
      lock()
    }
  }
}
//  End -->

function MM_popupMsg(msg) { //v1.0
  alert(msg);
}


//-->
</script>
          <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
     </head>

     <%
     dim cday
     dim cmonth

     cday = day(DATE)
     if len(cday) = 1 then
          cday = "0" &cday
     end if

     cmonth = month(DATE)
     if len(cmonth) = 1 then
          cmonth = "0" &cmonth
     end if
%>

     <body bgcolor="#ffffff">
          <form onsubmit="return check_form();" method="post" action="LifeLinePlusquote.asp" name="quoteForm">
          <table width="97%" border="0" cellpadding="4" cellspacing="0">
               <tr>
                    <td width="41%"><span class="style3">On your next Birthday will you be </span></td>
                    <td width="59%">
                         <div align="left">
                              <span id="sub1"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><img src="../../Images/helpPersonal.gif" alt="Click for Information" width="20" height="20" align="absmiddle" class="rapid1" onclick="MM_popupMsg('Please note that the maximum amount of cover in Lifeline Plus is £100,000 for clients below 60 and £50,000 for clients over 60.')"></font><select name="subageunder" onchange="closeselect(this,'sub1')">
                                        <option selected value="0">Lifeline Sum Assured</option><% Dim counter
counter=1
for counter = 1 to 100 %><% Response.Write "<OPTION value="&CStr(counter*1000) & ">" &CStr(counter*1000) & "</OPTION>" %><% NEXT %>
                                   </select> </span><span id="sub2"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><img src="../../Images/helpPersonal.gif" alt="Click for Information" width="20" height="20" align="absmiddle" class="rapid1" onclick="MM_popupMsg('Please note that the maximum amount of cover in Lifeline Plus is £100,000 for clients below 60 and £50,000 for clients over 60.')"></font><select name="subageover" onchange="closeselect(this,'sub2')">
                                        <option selected value="">Lifeline Sum Assured</option><% Dim ccounter
ccounter= 1
for ccounter = 1 to 50 %><% Response.Write "<OPTION value="&CStr(ccounter*1000) & ">" &CStr(ccounter*1000) & "</OPTION>" %><% NEXT %>
                                   </select> </span><select name="categoria" onmouseover="unlock()" onchange="selectSub(this)">
                                   <option value="" selected="selected">-- Age Attained --</option>
                                   <option value="ageunder">60 or Under?</option>
                                   <option value="ageover">Over 60?</option>
                              </select> <br>
                         </div>
                    </td>
               </tr>
               <tr>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
               </tr>
          </table>
          <table width="97%" height="345" border="0" cellpadding="4" cellspacing="0">
               <tr>
                    <td height="24">&nbsp;</td>
                    <td>&nbsp;</td>
                    <td width="3%" rowspan="15">&nbsp;</td>
                    <td width="2%" rowspan="15">&nbsp;</td>
               </tr>
               <tr>
                    <td width="41%" height="24"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Post Code</font></td>
                    <td width="54%"><input name="postcode1" id="postcode1" size="4" maxlength="4"> <input name="postcode2" id="postcode2" size="4" maxlength="4"></td>
               </tr>
               <tr>
                    <td height="32"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Policy Type</font></td>
                    <td>
                         <p><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><select name="Products" size="1" multiple id="Products" style="BACKGROUND-COLOR: white">
                                        <option value="F+, FV" selected="selected">LifeLine Plus</option>
                                   </select> </font></p>
                    </td>
               </tr>
               <tr>
                    <td height="30"><font face="Verdana" size="2">Inception Date</font></td>
                    <td><font size="3"><input name="dateStr2" size="1" maxlength="2" value="<%=cday%>"> / <input name="monthStr2" size="1" maxlength="2" value="<%=cmonth%>"> / <input name="yearStr2" size="4" maxlength="4" value="<%=year(DATE)%>"> </font></td>
               </tr>
               <tr>
                    <td><span class="style3">Your Lifeline Sum Assured </span></td>
                    <td><input name="subcategory" type="text" id="subcategory" size="5" maxlength="5" readonly="readonly"></td>
               </tr>
               <tr>
                    <td height="30" class="style3">Your Living Care Sum Assured</td>
                    <td valign="middle" class="style3">&pound; <input name="subcategory2" type="text" id="subcategory2" size="5" maxlength="5"></td>
               </tr>
               <tr>
                    <td height="30"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">D.O.B</font></td>
                    <td><font size="3"><input name="dateStr1" size="1" maxlength="2" value="01"> / <input name="monthStr1" size="1" maxlength="2" value="01"> / <input name="yearStr1" size="4" maxlength="4" value="1900"> </font></td>
               </tr>
               <tr>
                 <td height="24"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Age of Eldest Applicant</font></td>
                 <td><font size="2" face="Verdana, Arial, Helvetica, sans-serif">
                   <input name="Ages" size="2" maxlength="2" />
              </font></td>
            </tr>
               <tr>
                    <td height="32"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Gender</font></td>
                    <td><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><select name="Gender" id="Gender">
                                   <option selected="selected">Gender</option>
                                   <option value="M">Male</option>
                                   <option value="F">Female</option>
                              </select> </font></td>
               </tr>
               <tr>
                    <td height="32">&nbsp;</td>
                    <td><font size="2" face="Verdana, Arial, Helvetica, sans-serif">&nbsp; </font></td>
               </tr>
               <tr>
                    <td height="32">&nbsp;</td>
                    <td><font size="2" face="Verdana, Arial, Helvetica, sans-serif">&nbsp; </font></td>
               </tr>
               <tr>
                    <td height="32">&nbsp;</td>
                    <td><font size="2" face="Verdana, Arial, Helvetica, sans-serif">&nbsp; </font></td>
               </tr>
               <tr>
                    <td></td>
               </tr>
          </table>
          <div align="center">
               <br>
               <input name="calcpremium" type="image" src="../../Images/calculate.gif" alt="Calculate your premium based on the information that you have entered" width="136" height="30" border="0"><br>
               <br>
     </form><br>
     </body>

</html>Start Free Trial
[+][-]06.27.2005 at 04:24AM PDT, ID: 14307345

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.27.2005 at 04:50AM PDT, ID: 14307508

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.27.2005 at 04:55AM PDT, ID: 14307550

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.27.2005 at 04:57AM PDT, ID: 14307561

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.27.2005 at 05:00AM PDT, ID: 14307590

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.27.2005 at 05:02AM PDT, ID: 14307607

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.27.2005 at 05:10AM PDT, ID: 14307680

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.27.2005 at 05:29AM PDT, ID: 14307813

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.27.2005 at 05:35AM PDT, ID: 14307880

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.27.2005 at 05:36AM PDT, ID: 14307893

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.27.2005 at 06:01AM PDT, ID: 14308129

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.27.2005 at 06:10AM PDT, ID: 14308199

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.27.2005 at 06:13AM PDT, ID: 14308228

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.27.2005 at 06:16AM PDT, ID: 14308257

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.27.2005 at 06:19AM PDT, ID: 14308280

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.27.2005 at 06:19AM PDT, ID: 14308289

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.27.2005 at 06:21AM PDT, ID: 14308306

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.27.2005 at 06:22AM PDT, ID: 14308318

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.27.2005 at 06:23AM PDT, ID: 14308323

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.27.2005 at 06:31AM PDT, ID: 14308409

View this solution now by starting your 14-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Active Server Pages (ASP)
Tags: ageover, script, validate
Sign Up Now!
Solution Provided By: randeeps
Participating Experts: 2
Solution Grade: A
 
 
[+][-]06.27.2005 at 06:48AM PDT, ID: 14308529

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.27.2005 at 06:53AM PDT, ID: 14308577

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.27.2005 at 07:31AM PDT, ID: 14308967

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-43