Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    May 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Validation conflict and error on "validateRank" function

    Hello!

    I have created a form for a small charter school to assist us in registration, and I'm trying to add some validation scripts. All but one of my scripts are functional now, and operating simultaneously onSubmit.

    The latest version of the form itself is temporarily at: http://maccsreg.historyflows.com/index.html.

    At the bottom of the form is a table wherein students select classes. For their electives, they must also rank them in order of preference from 1 to 8. I am trying to validate their ranking, but something in the script is both rendering it nonfunctional and conflicting with the other scripts in the validation sequence.

    The validation code to check the rankings is:

    Code:
    var aFld = ["RankClass1", "RankClass2", "RankClass3", "RankClass4", "RankClass5", "RankClass6", "RankClass7", "RankClass8"];
    function validateRank(maccsreg){
    var used = new Array();
    for(i=0;i<aFld.length;i++){
      fName = aFld[i];
      rank = maccsreg[fName].value*1;
      if(!rank){
    	alert("Ranking Electives: Please rank your classes in order of preference from 1 to 8 (1=most favorite, 8=least favorite). You have not entered a rank for: "+fName);
    	maccsreg[fName].focus();
    	return false;
      }
      if(used[rank]==true){
    	alert("Ranking Electives: You may use a number only once in ranking items. You have used "+rank+" more than once.");
    	maccsreg[fName].focus();
    	return false;
      }
      used[rank]=true;
    }
    return true;
    }
    And a simplified (partial) version of the form is:

    Code:
    <form name="maccsreg" method="POST" action="" onSubmit="return (validateRank(this))">
    
    <table width="800" cellpadding="2" cellspacing="5" border="0">
        <tr>
            <td><script type="text/javascript">SetupElec1();</script><input type="hidden" id="ClassName7" name="ClassName7" size="35" value="" /></td>
            <td><input type="text" id="ClassReqs7" size="40" value=""></td>
            <td><input name="MeetsElecReqs1" type="checkbox" value="Reqs" style="background-color:#FC9"> I meet the requirements</td>
            <td><select name="RankClass7">
                <option value="" selected>&nbsp;</option>
                <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>
                </select></td>
            <td><input type="text" name="Credit7" id="Credit7" size="2" maxlength="2" value="0" readonly></td>
        </tr>
        <tr>
            <td><script type="text/javascript">SetupElec2();</script><input type="hidden" id="ClassName8" name="ClassName8" size="35" value="" /></td>
            <td><input type="text" id="ClassReqs8" size="40" value=""></td>
            <td><input name="MeetsElecReqs2" type="checkbox" value="Reqs" style="background-color:#FC9"> I meet the requirements</td>
            <td><select name="RankClass8">
                <option value="" selected>&nbsp;</option>
                <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>
                </select>
            <td><input type="text" name="Credit8" id="Credit8" size="2" maxlength="2" value="0" readonly></td>
        </tr>
        <tr>
        	<td colspan="4"><center><input type="submit" value="Submit Form" name="Submit">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    								<input type="reset" value="Clear Form" name="Reset"></center></td>
        </tr>
    </table>
    <br />
    <br />
    </form>
    Can anyone see where I've gone wrong? When I submit the form, it simply ignores the validation function and submits without validation. In addition, if I run that script as part of sequence of several which are fired onSubmit, whatever validation functions that come after it will also not work.

    Help?

    Thanks!

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Posts
    1,404
    Thanks
    2
    Thanked 32 Times in 32 Posts
    Seems to work fine (as soon as I edited out the first 6 drop-down names). Might want to add those errors into one string and prompt only once.

    Link is bad.

    Be sure to declare all those variables locally.

  • #3
    New to the CF scene
    Join Date
    May 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Validation conflict and error on "validateRank" function

    Hi there -

    Thanks for the reply. The correct link:

    http://maccsreg.desertrain.us/index.html

    The problem is that the script works fine in isolation (as presented above), but does *not* work in conjunction with other validation scripts. Here is the complete code for all the validation scripts running together (validateRank is last):

    Code:
    //START VALIDATION SEQUENCE ----------------------------
    
    // Validate Student Name Box
    function validateForm1(){
    if(document.maccsreg.StudentName.selectedIndex==0)
    {
    alert("Please select your name from the drop-down menu at the top of the page.");
    document.maccsreg.StudentName.focus();
    return false;
    }
    return true;
    }
    
    
    // Validate Textboxes
    function hasValue(strFieldName,strMsg)
    {
         var strValue = strFieldName.value;
              strValue = strValue.split(" ").join("");
         if(strValue == ""){
              alert("Please enter a value for "+ strMsg.toUpperCase() +" field");
                   strFieldName.focus();
                        return false;
              }
         return true;
    }
    
    
    //Validate Email
    function isEmail(strFieldName,strMsg)
    {
         var strEmail = strFieldName.value;
         var bolValid = true;
         if(!hasValue(strFieldName,strMsg)){
              bolValid = false;
         } else {
         if(strEmail.length < 7){
              bolValid = false;
         }
         if(strEmail.lastIndexOf(" ") >0){
              bolValid = false;
         }
         var intLastDot = strEmail.lastIndexOf(".")
         if(intLastDot == -1 ||  strEmail.length - intLastDot >4){
              bolValid = false;
         }
         var intAt = strEmail.lastIndexOf("@")
         if(intAt == -1 ||  strEmail.length - intAt < 5){
              bolValid = false;
         }
         if(! bolValid){
              alert(strMsg.toUpperCase() +" is not in the correct format");
                   strFieldName.focus();
                   }
              return bolValid;
         }
    }
    
    
    // Text Validation Function
    function validateForm(theForm){
         if(! isEmail(theForm["email"],"email")){
              return false;
              }
    	 if(! hasValue(theForm["ClassReqs1"],"item from the Humanities classes menu")){
              return false;
              }
    	 if(! hasValue(theForm["ClassReqs2"],"item from the Mathematics classes menu")){
              return false;
              }
    	 if(! hasValue(theForm["ClassReqs3"],"item the Science classes menu")){
              return false;
              }
         return true;
    }
    
    
    // Validate Radio Buttons and Checkboxes
    
    function validateRadio(form) {
    
    if (!document.maccsreg.GradeLevel[0].checked && !document.maccsreg.GradeLevel[1].checked  && !document.maccsreg.GradeLevel[2].checked){
    
    alert("Please select Grade Level");
    return false;}
    
    if(!document.maccsreg.MeetsHumReqs.checked){alert("Please indicated that you have met the requirements for this Humanities class");
    return false; }
    if(!document.maccsreg.MeetsMathReqs.checked){alert("Please indicated that you have met the requirements for this Math class");
    return false; }
    if(!document.maccsreg.MeetsSciReqs.checked){alert("Please indicated that you have met the requirements for this Science class");
    return false; }
    
    return true;
    }
    
    
    // Validate Select Box Rankings
    
    function validateRank(maccsreg){
    var aFld = maccsreg.getElementsByTagName('select');
    var used = new Array();
    for(i=0;i<aFld.length;i++){
      fName = aFld[i].name;
      rank = maccsreg[fName].value*1;
      if(!rank){
    	alert("Ranking Electives: Please rank your classes in order of preference from 1 to 8 (1=most favorite, 8=least favorite). You have not entered a rank for: "+fName);
    	maccsreg[fName].focus();
    	return false;
      }
      if(used[rank]==true){
    	alert("Ranking Electives: You may use a number only once in ranking items. You have used "+rank+" more than once.");
    	maccsreg[fName].focus();
    	return false;
      }
      used[rank]=true;
    }
    return true;
    }
    And here is my complete function call onSubmit in the form:

    <form name="maccsreg" method="POST" action="/cgi-bin/register.cgi" onSubmit="return (validateForm(this) && validateForm1(this) && validateRadio(this) && validateRank(this))">


    What happens when I click submit is that the first three functions validate their respective fields, and then the form simply submits before validating the ranking fields.

    Any ideas?

    Thanks!

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Posts
    1,404
    Thanks
    2
    Thanked 32 Times in 32 Posts
    Not enough time to look too closely now, but ... you've posted two different 'validateRank' function there. The first one used an array of names of the relevant selects to extract references to them (I'd have just used a while loop to generate consecutive names and check them, but that's irrelevant); the second, which I assume is the one you're using - didn't download the .js file - gets a collection of all the selects and checks them. Don't think that's what you intended.

    One other thing:

    <input type="reset" value="Clear Form" name="Reset" onclick="return confirm('Clear all entries?')">

    Helps avoid nasty e-mails. I'll take another look at this later, time permitting. Try using that function you originally posted and see what happens.

  • #5
    Senior Coder
    Join Date
    Jun 2002
    Posts
    1,404
    Thanks
    2
    Thanked 32 Times in 32 Posts
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>MACCS Registration Form</title>
    <script language="JavaScript" src="/global/code/populatetext.js"></script>
    <script language="JavaScript">
    
    /* Special thanks to the kind JavaScript Experts at http://www.experts-exchange.com who created many of these scripts:
       -- Jay Solomon [jaysolomon[\*AT\*]pclnet[\*DOT\*]net]
       -- Michel Plungjan [mplungjan[\*AT\*]spamcop[\*DOT*\}net]
       -- Zvonko, ee[\*AT\*]zvonko[\*DOT*\]net]
    */
    
    
    //START VALIDATION SEQUENCE ----------------------------
    
    var focus_el; //topmost invalid field
    
    // Validate Student Name Box
    function validateStudentName(f)
    {
       var msg = '';
       if (f.StudentName.selectedIndex == 0)
       {
          msg += '|>  Please select your name from the drop-down menu at the top of the page.\n';
          focus_el = f.StudentName;
       }
       return msg;
    }
    
    /* Validate Email
       -- Courtesy of Karen Gayda
       -- http://www.rgagnon.com/jsdetails/js-0063.html
    */
    function validateGoodEmail(f)
    {
       var field = f.email;
       var eaddy = field.value;
       var msg = '';
       var objRegExp  = /(^[a-z]([a-z_\.]*)@([a-z_\.]*)([.][a-z]{3})$)|(^[a-z]([a-z_\.]*)@  ([a-z_\.]*)(\.[a-z]{3})(\.[a-z]{2})*$)/i;
       if (!objRegExp.test(eaddy))
       {
          msg += '|>  E-mail address is not in the correct format.\n';
          if (focus_el == null) focus_el = field;
       }
       return msg;
    }
    
    // Validate Grade Level
    function validateGradeLevel(f)
    {
       var msg = '', field = f.GradeLevel[0];
       if (!f.GradeLevel[0].checked && !f.GradeLevel[1].checked && !f.GradeLevel[2].checked)
       {
          msg += "|>  Please select Grade Level.\n";
          if (focus_el == null) focus_el = field;
       }
       return msg;
    }
    
    // Validate Required Classes
    function validateReqClasses(f)
    {
       var msg = '';
       var hums = document.getElementById('Humanities');
       if (!hums.selectedIndex)
       {
          msg += "|>  Please select a Humanities class.\n";
          msg += "|>  Please indicate if you have met the requirements for this Humanities class (if any).\n";
          f.MeetsHumReqs.checked = false;
          if (focus_el == null) focus_el = hums;
       }
       var math = document.getElementById('Math');
       if (!math.selectedIndex)
       {
          msg += "|>  Please select a Math class.\n";
          msg += "|>  Please indicate if you have met the requirements for this Math class (if any).\n";
          f.MeetsMathReqs.checked = false;
          if (focus_el == null) focus_el = math;
       }
       var sci = document.getElementById('Science');
       if (!sci.selectedIndex)
       {
          msg += "|>  Please select a Science class.\n";
          msg += "|>  Please indicate if you have met the requirements for this Science class (if any).\n";
          f.MeetsSciReqs.checked = false;
          if (focus_el == null) focus_el = sci;
       }
       return msg;
    }
    
    // Validate Requirements Met
    function validateReqMet(f)
    {
       var msg = '';
       var hums = document.getElementById('Humanities');
       if (hums.value.match(/\|none\|/i))
       {
          f.MeetsHumReqs.checked = false;
       }
       if (hums.selectedIndex && !hums.value.match(/\|none\|/i) && !f.MeetsHumReqs.checked)
       {
          msg += '|>  Please indicate if you have met the requirements for this Humanities class (if any).\n';
          if (focus_el == null) focus_el = f.MeetsHumReqs;
       }
       var math = document.getElementById('Math');
       if (math.value.match(/\|none\|/i))
       {
          f.MeetsMathReqs.checked = false;
       }
       if (math.selectedIndex && !math.value.match(/\|none\|/i) && !f.MeetsMathReqs.checked)
       {
          msg += '|>  Please indicate if you have met the requirements for this Math class (if any).\n';
          if (focus_el == null) focus_el = f.MeetsMathReqs;
       }
       var sci = document.getElementById('Science');
       if (sci.value.match(/\|none\|/i))
       {
          f.MeetsSciReqs.checked = false;
       }
       if (sci.selectedIndex && !sci.value.match(/\|none\|/i) && !f.MeetsSciReqs.checked)
       {
          msg += '|>  Please indicate if you have met the requirements for this Science class (if any).\n';
          if (focus_el == null) focus_el = f.MeetsSciReqs;
       }
       return msg; 
    }
    
    //validate Rank
    function validateRank(f)
    {
       var sel, rank, allsels = f.getElementsByTagName('select');
       var msg = ''; 
       for (var i = 0; i < allsels.length; i++)
       {
          if (allsels[i].name.match(/RankClass/i))
          {
             sel = allsels[i];
             rank = sel.value * 1;
             if (!rank)
             {
                msg += '|>  You have not entered a rank for: Class ' + sel.name.match(/\d+$/) + '.\n';
             }
          }
       }
       if (msg)
       {
          msg = '\n|   Please rank classes in order of preference from 1 to 8\n|   1 --> most favorite  8 --> least favorite.\n\n' + msg;
       }
       if (focus_el == null) focus_el = sel;
       return msg;
    }
    
    function noDupes(selObj) //unique ranking
    {
       var f = selObj.form, sel, allsels = f.getElementsByTagName('select');
       for (var i = 0; i < allsels.length; i++)
       {
          if (allsels[i].name.match(/RankClass/i))
          {
             sel = allsels[i];
             if (selObj != sel && sel.value == selObj.value)
             {
                selObj.selectedIndex = 0;
             }
          }
       }
    }
    
    //master call
    function validate(f)
    {
       var msg = '';
       focus_el = null;
       msg += validateStudentName(f);
       msg += validateGoodEmail(f);
       msg += validateGradeLevel(f);
       msg += validateReqClasses(f);
       msg += validateReqMet(f);
       msg += validateRank(f);
       if (msg)
       {
          alert('\n' + msg + '\n');
          if (focus_el && focus_el.focus) focus_el.focus();
          if (focus_el && focus_el.select) focus_el.select();
          window.scrollBy(0, -20); //extra room at top
          return false;
       }
       return true; 
    }
    
    </script>
    <link rel="stylesheet" type="text/css" href="/global/style_maccs.css" media="all" />
    
    <script language="JavaScript">
    javascript:window.history.forward(1);
    </script>
    </head>
    
    <body>
    <form name="maccsreg" method="POST" action="javascript:alert('submitted')" onSubmit="return validate(this)">
    
    
    ----------------------------------->
    
    
        <tr>
        	<td colspan="4"><h4>Regularly Scheduled Classes</h4>
            Please select your classes from the menus below. A running total of credits is found at the bottom of your
            class list. You should have a grand total of <b><u>8 credits</u></b> before you submit this form.<br />
            <br />
            <b>NOTE:</b> All colored fields are required.</td>
    
        </tr>
        <tr>
            <td bgcolor="#99CCFF" bordercolor="#000000"><b>Class Name:</b></td>
            <td bgcolor="#99CCFF" bordercolor="#000000"><b>Requirements</b></td>
            <td bgcolor="#99CCFF" bordercolor="#000000"><b>Meets Requirements</b></td>
            <td bgcolor="#99CCFF" bordercolor="#000000"><b>Rank</b></td>
            <td bgcolor="#99CCFF" bordercolor="#000000"><b>Credits</b></td>
    
        </tr>
        <tr>
            <td width="25%"><script type="text/javascript">SetupHum();</script><input type="hidden" id="ClassName1" name="ClassName1" size="35" value="" /></td>
            <td width="35%"><input type="text" id="ClassReqs1" readonly="readonly" size="40" value="" style="background-color:#FC9;border:none;"></td>
            <td colspan="2"><input name="MeetsHumReqs" type="checkbox" value="Reqs" style="background-color:#FC9"> I meet the requirements</td>
            <td><input type="text" name="Credit1" id="Credit1" size="2" maxlength="2" value="0" style="background-color:#FC9" readonly></td>
        </tr>
    
        <tr>
            <td><script type="text/javascript">SetupMath();</script><input type="hidden" id="ClassName2" name="ClassName2" size="35" value="" /></td>
            <td><input type="text" id="ClassReqs2" readonly="readonly" size="40" value="" style="background-color:#FC9;border:none;"></td>
            <td colspan="2"><input name="MeetsMathReqs" type="checkbox" value="Reqs" style="background-color:#FC9"> I meet the requirements</td>
            <td><input type="text" name="Credit2" id="Credit2" size="2" maxlength="2" value="0" style="background-color:#FC9" readonly></td>
        </tr>
        <tr>
    
    		<td><script type="text/javascript">SetupSci();</script><input type="hidden" id="ClassName3" name="ClassName3" size="35" value="" /></td>
            <td><input type="text" id="ClassReqs3" readonly="readonly" size="40" value="" style="background-color:#FC9;border:none;"></td>
            <td colspan="2"><input name="MeetsSciReqs" type="checkbox" value="Reqs" style="background-color:#FC9"> I meet the requirements</td>
            <td><input type="text" name="Credit3" id="Credit3" size="2" maxlength="2" value="0" style="background-color:#FC9" readonly></td>
        </tr>
        <tr>
    		<td><script type="text/javascript">SetupLang();</script><input type="hidden" id="ClassName4" name="ClassName4" size="35" value="" /></td>
    
            <td><input type="text" id="ClassReqs4" readonly="readonly" size="40" value="" style="border:none;"></td>
            <td colspan="2"><input name="MeetsLangReqs" type="checkbox" value="Reqs" style="background-color:#FC9;border:none;"> I meet the requirements</td>
            <td><input type="text" name="Credit4" id="Credit4" size="2" maxlength="2" value="0" readonly></td>
        </tr>
        <tr>
    		<td><script type="text/javascript">SetupMathElec();</script><input type="hidden" id="ClassName5" name="ClassName5" size="35" value="" /></td>
            <td><input type="text" id="ClassReqs5" readonly="readonly" size="40" value="" style="border:none;"></td>
    
            <td colspan="2"><input name="MeetsMathElecReqs" type="checkbox" value="Reqs" style="background-color:#FC9;border:none;"> I meet the requirements</td>
            <td><input type="text" name="Credit5" id="Credit5" size="2" maxlength="2" value="0" readonly></td>
        </tr>
        <tr>
    		<td><script type="text/javascript">SetupSciElec();</script><input type="hidden" id="ClassName6" name="ClassName6" size="35" value="" /></td>
            <td><input type="text" id="ClassReqs6" readonly="readonly" size="40" value="" style="border:none;"></td>
            <td colspan="2"><input name="MeetsSciElecReqs" type="checkbox" value="Reqs" style="background-color:#FC9;border:none;"> I meet the requirements</td><br />
    
          <td><input type="text" name="Credit6" id="Credit6" size="2" maxlength="2" value="0" readonly></td>
        </tr>
        <tr>
            <td><script type="text/javascript">SetupElec1();</script><input type="hidden" id="ClassName7" name="ClassName7" size="35" value="" /></td>
            <td><input type="text" id="ClassReqs7" readonly="readonly" size="40" value="" style="border:none;"></td>
            <td><input name="MeetsElecReqs1" type="checkbox" value="Reqs" style="background-color:#FC9;border:none;"> I meet the requirements</td>
            <td><select name="RankClass7" id="RankClass7">
    
                <option value="" selected>&nbsp;</option>
                <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>
                </select></td>
            <td><input type="text" name="Credit7" id="Credit7" size="2" maxlength="2" value="0" readonly></td>
        </tr>
        <tr>
    
            <td><script type="text/javascript">SetupElec2();</script><input type="hidden" id="ClassName8" name="ClassName8" size="35" value="" /></td>
            <td><input type="text" id="ClassReqs8" readonly="readonly" size="40" value="" style="border:none;"></td>
            <td><input name="MeetsElecReqs2" type="checkbox" value="Reqs" style="background-color:#FC9"> I meet the requirements</td>
            <td><select name="RankClass8" id="RankClass8" onchange="noDupes(this)">
                <option value="" selected>&nbsp;</option>
                <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>
    
                </select>
            <td><input type="text" name="Credit8" id="Credit8" size="2" maxlength="2" value="0" readonly></td>
        </tr>
        <tr>
            <td><script type="text/javascript">SetupElec3();</script><input type="hidden" id="ClassName9" name="ClassName9" size="35" value="" /></td>
            <td><input type="text" id="ClassReqs9" readonly="readonly" size="40" value="" style="border:none;"></td>
            <td><input name="MeetsElecReqs3" type="checkbox" value="Reqs" style="background-color:#FC9"> I meet the requirements</td>
    
            <td><select name="RankClass9" id="RankClass9" onchange="noDupes(this)">
                <option value="" selected>&nbsp;</option>
                <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>
                </select></td>
            <td><input type="text" name="Credit9" id="Credit9" size="2" maxlength="2" value="0" readonly></td>
        </tr>
        <tr>
    
            <td><script type="text/javascript">SetupElec4();</script><input type="hidden" id="ClassName10" name="ClassName10" size="35" value="" /></td>
            <td><input type="text" id="ClassReqs10" readonly="readonly" size="40" value="" style="border:none;"></td>
            <td><input name="MeetsElecReqs4" type="checkbox" value="Reqs" style="background-color:#FC9"> I meet the requirements</td>
            <td><select name="RankClass10" id="RankClass10" onchange="noDupes(this)">
                <option value="" selected>&nbsp;</option>
                <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>
    
                </select></td>
            <td><input type="text" name="Credit10" id="Credit10" size="2" maxlength="2" value="0" readonly></td>
        </tr>
        <tr>
            <td><script type="text/javascript">SetupElec5();</script><input type="hidden" id="ClassName11" name="ClassName11" size="35" value="" /></td>
            <td><input type="text" id="ClassReqs11" readonly="readonly" size="40" value="" style="border:none;"></td>
            <td><input name="MeetsElecReqs5" type="checkbox" value="Reqs" style="background-color:#FC9"> I meet the requirements</td>
    
            <td><select name="RankClass11" id="RankClass11" onchange="noDupes(this)">
                <option value="" selected>&nbsp;</option>
                <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>
                </select></td>
            <td><input type="text" name="Credit11" id="Credit11" size="2" maxlength="2" value="0" readonly></td>
        </tr>
        <tr>
    
            <td><script type="text/javascript">SetupElec6();</script><input type="hidden" id="ClassName12" name="ClassName12" size="35" value="" /></td>
            <td><input type="text" id="ClassReqs12" readonly="readonly" size="40" value="" style="border:none;"></td>
            <td><input name="MeetsElecReqs6" type="checkbox" value="Reqs" style="background-color:#FC9"> I meet the requirements</td>
            <td><select name="RankClass12" id="RankClass12" onchange="noDupes(this)">
                <option value="" selected>&nbsp;</option>
                <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>
    
                </select></td>
            <td><input type="text" name="Credit12" id="Credit12" size="2" maxlength="2" value="0" readonly></td>
        </tr>
        <tr>
            <td><script type="text/javascript">SetupElec7();</script><input type="hidden" id="ClassName13" name="ClassName13" size="35" value="" /></td>
            <td><input type="text" id="ClassReqs13" readonly="readonly" size="40" value="" style="border:none;"></td>
            <td><input name="MeetsElecReqs7" type="checkbox" value="Reqs" style="background-color:#FC9"> I meet the requirements</td>
    
            <td><select name="RankClass13" id="RankClass13" onchange="noDupes(this)">
                <option value="" selected>&nbsp;</option>
                <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>
                </select></td>
            <td><input type="text" name="Credit13" id="Credit13" size="2" maxlength="2" value="0" readonly></td>
        </tr>
        <tr>
    
            <td><script type="text/javascript">SetupElec8();</script><input type="hidden" id="ClassName14" name="ClassName14" size="35" value="" /></td>
            <td><input type="text" id="ClassReqs14" readonly="readonly" size="40" value="" style="border:none;"></td>
            <td><input name="MeetsElecReqs8" type="checkbox" value="Reqs" style="background-color:#FC9"> I meet the requirements</td>
            <td><select name="RankClass14" onchange="noDupes(this)">
                <option value="" selected>&nbsp;</option>
                <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>
    
                </select></td>
            <td><input type="text" name="Credit14" id="Credit14" size="2" maxlength="2" value="0" readonly></td>
        </tr>
        <tr>
            <td colspan="4" align="right"><input type="button" name="add" value="Click Here for Total Credits"
                              onClick="document.maccsreg.sum.value =
                                parseFloat(document.maccsreg.Credit1.value) +
                                parseFloat(document.maccsreg.Credit2.value) +
                                parseFloat(document.maccsreg.Credit3.value) +
                                parseFloat(document.maccsreg.Credit4.value) +
                                parseFloat(document.maccsreg.Credit5.value) +
                                parseFloat(document.maccsreg.Credit6.value) +
                                parseFloat(document.maccsreg.Credit7.value) +
                                parseFloat(document.maccsreg.Credit8.value) +
                                parseFloat(document.maccsreg.Credit9.value) +
                                parseFloat(document.maccsreg.Credit10.value) +
                                parseFloat(document.maccsreg.Credit11.value) +
                                parseFloat(document.maccsreg.Credit12.value) +
                                parseFloat(document.maccsreg.Credit13.value) +
                                parseFloat(document.maccsreg.Credit14.value)"></td>
            <td><input name="sum" size="2" readonly></td>
        </tr>
        <tr>
        	<td colspan="4"><center><input type="submit" value="Submit Form" name="Submit">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    								<input type="reset" value="Clear Form" name="Reset" onclick="return confirm('Clear all entries?')"></center></td>
        </tr>
    </table>
    </form> 
    <div style="height:200px;"></div>
    </body>
    </html>
    Last edited by adios; 05-20-2009 at 07:32 AM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •