如题,我是xajax菜鸟,请大家家帮帮忙
<?php
require_once('libs/xajax/xajax.inc.php');
function postcomment($form) {
     $objResponse = new xajaxResponse();
     $UserName = xml_escape($form['UserName']);
     if(empty($UserName)){
          $objResponse->addAssign("successmsg","innerHTML","用户名必须填写");
          }
          return $objResponse;
}
$xajax = new xajax();
$xajax->registerFunction("postcomment");
$xajax->processRequests();
?><!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=gb2312" />
<title>xajax留言评论处理例子</title>
<?php echo $xajax->getJavascript('libs/xajax'); ?>
<script type="text/javascript">
             function sendcomment(){                 xajax.$('addsubmit').disabled=true;                 xajax.$('addsubmit').value="wait...";                 xajax_postcomment(xajax.getFormValues("commentform"));                 return false;             }     </script>
</head>
<body>
<h4 id="respond">发表评论</h4><form name="commentform" id="commentform" onSubmit="sendcomment();" action="javascript:void(null);" method="get">     <p><span id="successmsg" class="errormsg"></span></p>     <p>
  <input type="text" name="UserName" id="UserName" value="" size="22" tabindex="1" /> <label for="author"><strong>姓名</strong>(必填)</label>
  </p>     <p><input name="addsubmit" id="addsubmit" type="submit" tabindex="5" value="提交评论" />     <input type="hidden" name="BlogID" value="<>" />     </p>
</form>
</body>
</html>