Hello all I'm really new at this JavaScript, I was backing up the web site admin until he left and my boss made me the admin I was asked to make a form more user friendly and I was able to get most of it done until my select field broke. What I can gather is the admin before me used a lot of CGI script and with the form not showing all the fields when the page loads the CGI script is not executing. I have not been able to find any away to make this work on the web. Any help would be great. Below is the code for the index page and the CGI script. Also you can see part of the page at https://www.umn.edu/cco/test/JimTest/ I.m unable to show a full working page because there are phone numbers that I can not post....
If you have any question please let me know.
Thanks a lot
Jim


index.shtml
Code:
<html>
<head>
<link rel="stylesheet" href="/cco/include/umn.css" type="text/css">
<style type="text/css"><!--
@import url(/cco/include/umnglobalbkgimg.css);
--></style>
<title>On-Call List Search</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<script type="text/javascript">
	window['pageid']='oncall';
</script>

<!-- ADDED SCRIPT -->
<script type="text/javascript" src="usableforms.js"></script>
<script language="javascript" type="text/javascript" src="datetimepicker.js"></script>
<script language="javascript" type="text/javascript" src="combofield.js"></script>
<!-- END OF SCRIPT -->

<script language="JavaScript">
  <!-- hide
    function newWindow(opt) {
      var input = document.URL
      var s = input.split("/");
     for(var i = 0;i < s.length;i++) {
//        document.write(s[i]+"<br>");
//        print (s[i]+"\r\n");
        if (s[i] == "phonelist") {
          var dir = (s[i]);
        }
        if (s[i] == "oncall") {
          var dir = (s[i]);
        }
      }
      var newWindow = window.open('https://www.umn.edu/cco/'+dir+'/faq/'+opt+'.shtml', opt+'Win', 'width=550,height=310,scrollbars=yes,resizable=yes');
    }

    function validDate(form) {
// Check which option, if any, is selected.
      var typeSelected="N";
      for (var t=0; t<form.type.length; t++) {
        if (form.type[t].checked) {
          var type = form.type[t].value;
          var typeSelected="Y";
        }
      }

// Validate for option selected.
      if (typeSelected == "N") {
        alert("No option selected.  Please select one of the "+t+" options.");
        return false;
      }

// Validate for Option 1 & 2.
      if (type == "job" || type == "name") {
        if (form.val.value == "") {
          alert("Keyword blank. Must enter Keyword.");
          return false;
        }

        var multiKeyword="N";
        var sear = form.val.value;
        var splitSearch = sear.split(" ");
        for(var i = 0;i < splitSearch.length;i++) {
          if (i > 0) {
            var multiKeyword="Y";
          }
        }
        if (multiKeyword == "Y") {
          alert("Multiple Keywords not supported. Enter just 1(one) Keyword.");
          return false;
        }
      }

// Validate for Option 3 & 4.
      if (type == "grp" || type == "grplst" || type == "grpdate") {
        if (form.grp.value == "") {
          alert("A Group was not selected.");
          return false;
        }
      }

// Validate for Option 5 - Date Only.
      if (type == "grpdate") {
        var formDate = [form.year.value]+[form.mon.value]+[form.day.value];
        var formDay = [form.day.value];
        var formMonth = [form.mon.value];
        var formYear = [form.year.value];

      if (formMonth == 1 || formMonth == 3 || formMonth == 5 || formMonth == 7 || formMonth == 8 || formMonth == 10 || formMonth == 12) {
        formMaxDay=31
      }
      if (formMonth == 4 || formMonth == 6 || formMonth == 9 || formMonth == 11) {
        formMaxDay=30
      }
      if (formMonth == 2) {
        if (((formYear % 4) == 0 && (formYear % 100) > 0) || (formYear % 400) == 0) {
          formMaxDay=29
        }
        else {
          formMaxDay=28
        }
      }
      if (formDay > formMaxDay) {
        alert("Not a valid Date.  Please try again.");
        return false;
      }

        var now = new Date;

        var monName = new Array (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);

        var year = now.getYear();
        if (year < 2000) {
          var pyear = now.getYear()+1899;
          var cyear = now.getYear()+1900;
          var nyear = now.getYear()+1901;
        }
        if (year > 2000) {
          var pyear = now.getYear()-1;
          var cyear = now.getYear();
          var nyear = now.getYear()+1;
        }

        var curMon = monName[now.getMonth()];

        var curDay  = now.getDate();
        if (curDay < 10) {
          var curDay = 0+[curDay];
        }
        var firstPos = monName[now.getMonth()]-3;
        if (firstPos == 0) {
          var firstPos = 12;
        }
        if (firstPos == -1) {
          var firstPos = 11;
        }
        if (firstPos == -2) {
          var firstPos = 10;
        }
        if (firstPos < 10) {
          var firstPos = 0+[firstPos];
        }

        var lastPos  = monName[now.getMonth()]+3;
        if (lastPos == 13) {
          var lastPos = 1;
        }
        if (lastPos == 14) {
          var lastPos = 2;
        }
        if (lastPos == 15) {
          var lastPos = 3;
        }
        if (lastPos < 10) {
          var lastPos = 0+[lastPos];
        }

      if (firstPos == 1 || firstPos == 3 || firstPos == 5 || firstPos == 7 || firstPos == 8 || firstPos == 10 || firstPos == 12) {
        maxDay=31
      }
      if (firstPos == 4 || firstPos == 6 || firstPos == 9 || firstPos == 11) {
        maxDay=30
      }
      if (firstPos == 2) {
        if (((cyear % 4) == 0 && (cyear % 100) > 0) || (cyear % 400) == 0) {
          maxDay=29
        }
        else {
          maxDay=28
        }
      }

      if (curDay > maxDay) {
        outDay = maxDay;
      }
      else {
        outDay = curDay;
      }

        if (firstPos > 9) {
          var firstDate = [pyear]+[firstPos]+[outDay];
          var invalidMess = ("Must be between "+firstPos+"/"+outDay+"/"+pyear+" and "+lastPos+"/"+outDay+"/"+nyear+".");
        }
        if (firstPos < 10) {
          var firstDate = [cyear]+[firstPos]+[outDay];
          var invalidMess = ("Must be between "+firstPos+"/"+outDay+"/"+cyear+" and "+lastPos+"/"+outDay+"/"+nyear+".");
        }
        var lastDate  = [nyear]+[lastPos]+[outDay];

        if (formDate < firstDate) {
          alert("Invalid Date.  Please try again. "+invalidMess);
          return false;
        }
        if (formDate > lastDate) {
          alert("Invalid Date.  Please try again. "+invalidMess);
          return false;
        }
      }
// End of Option 5 Date Check
      return true;
    }


  // done hiding -->
</script>

<!--#include virtual="/cco/include/left_scr.txt" -->

</head>

<body bgcolor="#FFFFFF" onLoad="setbold(window.pageid);">
<!--#include virtual="/cco/include/header_nav.txt" -->
<!--#include virtual="/cco/include/header.txt" -->

<!--#include virtual="/cco/include/title.txt" -->

<!-- BEGIN BODY -->

<table width="760" border="0" cellpadding="0" cellspacing="0">
  <tr>

<!--#include virtual="/cco/include/left_nav.txt" -->

    <!-- BEGIN BODY CONTENT EAS-SS -->
	    <td width="569" valign="top">



<td width="569" valign="top"><table width="569" border="0" cellpadding="0" cellspacing="0">
      </table>

      <table width="569" border="0" cellpadding="0" cellspacing="10">
        <tr>
          <td valign="top">
<!--include virtual="/cgi-bin/do?user=cco&prog=mlp_access.cgi&page=phonelist.txt&loc=/hotel/cco/web-docs/phonelist&grp=PHONE" -->
<!--include virtual="/cgi-bin/do?user=cco&prog=mlp_access.cgi&page=phonelist.txt&loc=/hotel/cco/web-docs/phonelist&grp=WEB" -->
<!--#include virtual="phoneupdate.txt" -->
          </td>
        </tr>
      </table>

	    <!-- END BODY CONTENT -->
		 </td>
  </tr>

</table>
<!-- END BODY -->

<!--#include virtual="/cco/include/footer.txt" -->
<!--continuation of footer-->
<!--#config timefmt="%B %d, %Y"--><!--#ECHO VAR="LAST_MODIFIED"--></div></td>

        </tr>
      </table></td>
  </tr>
</table>
<!--end of footer-->
</body>
</html>
phoneupdate.cgi
Code:
<!-- BEGIN phonelist.txt -->

<!--form name="calllist" method="post" action="phone.cgi"-->
<form  onSubmit="return validDate(this)" name="calllist" method="get" action="phone.shtml">
<table border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td valign="top" colspan="5"><h2>On-Call List Search</h2></td>
  </tr>
  <tr>
    <td colspan="5">
      <p>
      <p>Here you will find the CCO On-Call List. By selecting one of the options below you can find the primary on-call person for the appropriate group/job.<font class="bodytext"></font></p>
    </td>
  </tr>
  <tr> 
    <td colspan="5"> 
      <hr>
    </td>
  </tr>
  <tr class="bodytext"> 
    <th align="left" width="26%">Options:</th>
    <td align="left" colspan="4"> 
      <INPUT TYPE="radio" NAME="type" VALUE="job" rel="jobContract">
        1) Search for Keyword. <a href="javascript:newWindow('s1')"><img src="/cco/images/info.gif" border="0" alt="Additional Information."></a><br>
      <INPUT TYPE="radio" NAME="type" VALUE="name" rel="jobContract">
        2) Search for a Person. <a href="javascript:newWindow('s2')"><img src="/cco/images/info.gif" border="0" alt="Additional Information."></a><br>
      <INPUT TYPE="radio" NAME="type" VALUE="grp" rel="grpContract">
        3) Search for On-Call Group. <a href="javascript:newWindow('s3')"><img src="/cco/images/info.gif" border="0" alt="Additional Information."></a><br>
      <INPUT TYPE="radio" NAME="type" VALUE="grplst" rel="grpContract">
        4) Search for listing of responsibilities for an On-Call Group. <a href="javascript:newWindow('s4')"><img src="/cco/images/info.gif" border="0" alt="Additional Information."></a><br>
      <INPUT TYPE="radio" NAME="type" VALUE="grpdate" rel="grpdateContract">
        5) Search for who is on call by date. <a href="javascript:newWindow('s5')"><img src="/cco/images/info.gif" border="0" alt="Additional Information."></a>
	</td>
  </tr>
  <tr> 
    <td colspan="5"> 
      <hr>
    </td>
  </tr>
  <tr class="bodytext" rel="jobContract"> 
    <th align="left" width="26%">Enter Keyword:</th>
    <td colspan="4" align="left"> 
      <input type="text" name="val">
    </td>
  </tr>
  <tr class="bodytext" rel="grpContract">
    <th align="left" width="26%">Groups:</th>
    <td colspan="4" align="left"> 
      <select name="grp">
        <option value="">Select a Group...
		
        include;phonegrpupd_new.cgi sear

      </select>
    </td>
  </tr>
    <tr class="bodytext" rel="grpdateContract">
    <th align="left">Date:</th>
    <td class="bodytext" align="left"><label for="val"></label></td>
	<td align="left">
	<input id="CalDate" name="CalDate" type="text" size="20"><a href="javascript:NewCal('CalDate','mmddyyyy')"><img src="images/cal.gif" width="16" height="16" border="0" alt="CalDate"></a>
    </td>
  </tr>
   <tr class="bodytext" rel="grpdateContract">
    <th align="left" width="26%">Groups:</th>
    <td colspan="4" align="left"> 
      <select name="grp">
        <option value="">Select a Group...

        include;phonegrpupd_new.cgi sear

      </select>
    </td>
  </tr>
 
  <tr> 
    <td colspan="5"> 
      <hr>
    </td>
  </tr>
  <tr> 
    <td align="center" colspan="5"><font class="bodytext">After choosing your option above, click <b>Submit</b>.</font> </td>
  </tr>
  <tr> 
    <td align="center" colspan="5"> 
      <INPUT TYPE="submit" VALUE="Submit">
      <INPUT TYPE="reset" VALUE="CLEAR">
    </td>
  </tr>
</table>
</form>

<!-- END phonelist.txt -->
Thanks again for reading my post.....