ue","继续"); //修改submitButton的value为继续 $objResponse->addAssign("submitButton","disabled",false); //修改submitButton这个按扭的属性 } return $objResponse; }
$xajax->processRequests(); ?>
这个文件中对信息进行了有效性判断,包括:用户名是否已经注册过、信息中是否有非法字符、邮件地址是否正确、两次输入的密码是否一致,如果没有错误则输入到数据库中,并 $objResponse->addAssign("formDiv","innerHTML",$sForm); 在formDiv中重新插入代码,内容为$sForm $sForm = "注册成功<br>用户名:".$usr."<br>email:".$email."";
如果有错误信息则 $objResponse->addAlert($errmsg); //弹出错误信息 $objResponse->addAssign("submitButton","value","继续"); $objResponse->addAssign("submitButton","disabled",false); //修改submitButton这个按扭的属性
3、login.php 登陆文件
<?php require_once("inc/xajax.inc.php"); $xajax = new xajax("inc/login.php"); $xajax->registerFunction("processForm"); ?> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <link rel="stylesheet" href="" _fcksavedurl="""" type="text/css"> <title>无标题文档</title> <?php $xajax->printJavascrīpt(''inc/''); ?> <scrīpt type="text/javascrīpt"> function submitSignup() { xajax.$(''submitButton'').disabled=true; xajax.$(''submitButton'').value="..."; xajax_processForm(xajax.getFormValues("signupForm")); return false; } </scrīpt> </head> <body><form id="signupForm" action="javascrīpt:void(null);" ōnSubmit="submitSignup();"> <div id="main"> <div id="m1">用 户 登 陆</div> <div id="formDiv"> <table width="100%" border="0" cellspacing="0" cellpadding="5"> <tr> <td align="right"> </td> <td> </td> </tr> <tr> <td width="31%" align="right">用户名:</td> <td width="69%"><input name="usr" type="text" id="usr" />   |