  <br>
  <table border=1 cellspacing=1 cellpadding=2 width=760 style="border: 1px inset;">
  <form action="controllers/inputController.php" method="post" name="doform" id="doform">
  <input name="item_dopkey" id="item_dopkey" type="hidden" value="<?=$do_data['do_pkey'];?>">
  <input name="item_pkey" id="item_pkey" type="hidden" value="<?=$item_data['item_pkey'];?>">
  <input name="item_no" id="item_no" type="hidden" value="0">
  <!--
  <tr valign=top>
  <td valign=top width=150 class=formlabel>Item No</td>
  <td valign=top width=610 class=formvalue>
  <input name="item_no" id="item_no" type="text" value="<?=$item_data['item_no'];?>" maxlength=3 style="width: 60px;" onKeypress="integerOnly();">
  </td>
  </tr>
  -->
  <tr valign=top>
  <td valign=top width=150 class=formlabel>Description *</td>
  <td valign=top width=610 class=formvalue>
  <input name="item_subsubtradepkey" id="item_subsubtradepkey" type="hidden" value="<?=$item_data['item_subsubtradepkey'];?>">
  <input name="item_description" id="item_description" type="text" value="<?=unescape($item_data['item_description']);?>" style="width: 360px;">
  &nbsp;<button name="selecttrade" id="selecttrade" type="button" onClick="selectTrade('<?=$objtradepkeys;?>');">Select Trade..</button>
  </td>
  </tr>
  <tr valign=top>
  <td valign=top width=150 class=formlabel>Unit</td>
  <td valign=top width=610 class=formvalue>
  <input name="item_unit" id="item_unit" type="text" value="<?=$item_data['item_unit'];?>" readonly maxlength=40 style="width: 180px;">
  </td>
  </tr>
  <tr valign=top>
  <td valign=top width=150 class=formlabel>Quantity Delivered *</td>
  <td valign=top width=610 class=formvalue>
  <input name="item_quantity" id="item_quantity" type="text" value="<?=number_format($item_data['item_quantity'],4);?>" maxlength=21 style="width: 180px;" onChange="setAccepted();" onKeypress="decimalOnly();">
  </td>
  </tr>
  <tr valign=top>
  <td valign=top width=150 class=formlabel>Quantity Accepted *</td>
  <td valign=top width=610 class=formvalue>
  <input name="item_accepted" id="item_accepted" type="text" value="<?=number_format($item_data['item_accepted'],4);?>" maxlength=21 style="width: 180px;" onKeypress="decimalOnly();">
  </td>
  </tr>
  <input name="job" id="job" type="hidden" value="">
  </form>
  </table>

  <script type="text/javascript">

  function setAccepted() {
    var itemqty = document.doform.item_quantity.value;
    document.doform.item_accepted.value = itemqty;
  }

  function selectTrade(tradepkeys) {
    window.open('views/ibox_selecttrade-limited.php?trades='+tradepkeys,'selectwindow', 'menubar=0,toolbar=0,scrollbars=1,resizable=0,location=0,width=600,height=600');
  }

  function validateForm() {

    var isvalid=true;
    var errmsg="";
    var itemqty=document.getElementById('item_quantity');
    var itemaccepted=document.getElementById('item_accepted');
    var itemsubsub=document.getElementById('item_subsubtradepkey');

    if ((itemqty.value=="")||(itemaccepted.value=="")||(itemsubsub.value=="")) {
      errmsg='Item Description, Delivered Quantity and Accepted Quantity must be specified!\n';
      isvalid=false;
    }
    if (isvalid==false) alert('Error:\n'+errmsg);
    return isvalid;

  }

  </script>
