  <br>
  <table border=1 cellspacing=1 cellpadding=2 width=760 style="border: 1px inset;">
  <form action="controllers/inputController.php" method="post" name="userform" id="userform">
  <input name="user_pkey" id="user_pkey" type="hidden" value="<?=$user_data['user_pkey'];?>">
  <input name="user_type" id="user_type" type="hidden" value="<?=$user_data['user_type'];?>">
  <input name="user_password" id="user_password" type="hidden" value="<?=$user_data['user_password'];?>">
  <input name="user_status" id="user_status" type="hidden" value="<?=$user_data['user_status'];?>">
  <tr valign=top>
  <td valign=top width=150 class=formlabel>User Name</td>
  <td valign=top width=610 class=formvalue>
  <input name="user_name" id="user_name" type="text" value="<?=$user_data['user_name'];?>" style="width: 240px;" onkeypress="alphanumericOnly();">&nbsp;&nbsp;<i>(lowercase a-z and numbers only)</i>
  </td>
  </tr>
  <tr valign=top>
  <td valign=top width=150 class=formlabel>User Level</td>
  <td valign=top width=610 class=formvalue>
  <select name="user_role" id="user_role" style="width: 240px;">
  <option value="0" selected>--Select Level--</option>
  <option value="1" <? if ($user_data['user_role']==1) echo "selected"; ?>>Standard User</option>
  <option value="2" <? if ($user_data['user_role']==2) echo "selected"; ?>>System Administrator</option>
  </select>
  </td>
  </tr>
  <tr valign=top>
  <td valign=top width=150 class=formlabel>Access Group</td>
  <td valign=top width=610 class=formvalue>
  <select name="user_grouppkey" id="user_grouppkey" style="width: 240px;">
  <? include_once('object-selectusergroup.tpl'); ?>
  </select>
  </td>
  </tr>
  <input name="job" id="job" type="hidden" value="">
  </form>
  </table>

  <script type="text/javascript">

  function validateForm() {

    var isvalid=true;
    var errmsg="";
    var username=document.getElementById('user_name');
    var userrole=document.getElementById('user_role');
    var usergroup=document.getElementById('user_grouppkey');
    var usernamestr=username.value;

    if ((username.value=="")||(userrole.value=="0")||(usergroup.value=="")) {
      errmsg='User Name, User Level and Access Group must be specified!\n';
      isvalid=false;
    }
    if (isNumeric(username.value)) {
      errmsg+='Invalid User Name specified!\nUser Name must contain the letters a-z!';
      isvalid=false;
    }
    //if (usernamestr.substring(0,1)=="0") {
    //  errmsg+='Invalid User Name specified!\nUser Name must start with a letter!';
    //  isvalid=false;
    //}
    if (isvalid==false) alert('Error:\n'+errmsg);
    return isvalid;

  }

  </script>
