修改目的:用户注册时不用输入笔名,实现系统自动同步用户名和用户笔名。
//用户笔名重复检测 if($cfg_mb_wnameone=='N') { $row = $dsql->GetOne("SELECT * FROM `dede_member` WHERE uname LIKE '$uname' "); if(is_array($row)) { ShowMsg('用户笔名或公司名称不能重复!', '-1'); exit(); }
//AJAX changChickValue
$("#txtUsername").change( function() {
$.ajax({type: reMethod,url: "index_do.php",
data: "dopost=checkuser&fmdo=user&cktype=1&uid="+$("#txtUsername").val(),
dataType: 'html',
success: function(result){$("#_userid").html(result);}});
});
修改成
//AJAX changChickValue
$("#txtUsername").change( function() {
$.ajax({type: reMethod,url: "index_do.php",
data: "dopost=checkuser&fmdo=user&cktype=1&uid="+$("#txtUsername").val(),
dataType: 'html',
success: function(result){
$("#_userid").html(result);
$("#uname").val($("#txtUsername").val());
}});
});