  <table border=1 cellspacing=1 cellpadding=2 width=760 style="border: 1px inset;">
  <form action="controllers/inputController.php" method="post" name="userform" id="userform">
  <tr valign=top>
  <td valign=top width=150 class=formlabel>Dept Code</td>
  <td valign=top width=610 class=formvalue>
  <input name="dept_pkey" id="dept_pkey" type="hidden" value="<?=$dept_data['dept_pkey'];?>">
  <input name="dept_code" id="dept_code" type="text" value="<?=$dept_data['dept_code'];?>" style="width: 180px;">
  </td>
  </tr>
  <tr valign=top>
  <td valign=top width=150 class=formlabel>Dept Name</td>
  <td valign=top width=610 class=formvalue>
  <input name="dept_name" id="dept_name" type="text" value="<?=$dept_data['dept_name'];?>" style="width: 580px;">
  </td>
  </tr>
  <tr valign=top>
  <td valign=top width=150 class=formlabel>Division</td>
  <td valign=top width=610 class=formvalue>
  <select name="dept_divpkey" id="dept_divpkey" style="width: 360px;">
  <? include_once('object-selectdivision.tpl'); ?>
  </select>
  </td>
  </tr>
  <tr valign=top>
  <td valign=top width=150 class=formlabel>Description</td>
  <td valign=top width=610 class=formvalue>
  <input name="dept_description" id="dept_description" type="text" value="<?=$dept_data['dept_description'];?>" style="width: 580px;">&nbsp;
  </td>
  </tr>
  <input name="job" id="job" type="hidden" value="">
  </form>
  </table>

  <script type="text/javascript">

  function validateForm() {

    var isvalid=true;
    var errmsg="";
    var deptcode=document.getElementById('dept_code');
    var deptname=document.getElementById('dept_name');
    var deptdiv=document.getElementById('dept_divpkey');

    if ((deptcode.value=="")||(deptname.value=="")||(deptdiv.value=="")) {
      errmsg='Department Code, Name and Division must be specified!\n';
      isvalid=false;
    }
    if (isvalid==false) alert('Error:\n'+errmsg);
    return isvalid;

  }

  </script>
