jQuery code:
$(document).ready(function(){
$("#Text1").bind("change",function(){
$.ajax({
type:"Get",
url:"/AjaxPages/AjaxCode.aspx",
dataType:"text",
data:"username="+$("#Text1").val()+"&flg=username",
success:function(msg)
{
// $("#showResult")(msg);
//alert(msg);
$("#lbCheckUserName")(msg);
//$("[id$=lbCheckUserName]")(msg);
}
});
});
$("#TextBox1").bind("change",function(){
var reg=/^[0-9]{6,}$/;
var password=$("#TextBox1").val();
if(password.match(reg))
{
$("#CheckPassword").val()="OK";
}
else
{
$("#CheckPassword").val()="Error";
}
});
});
Text1 那个是好用的,可是改变TextBox1的内容就会报错“Cannt assign to a function result ”,没看出原因来,请给位高手帮忙解答下,十分感谢!
------解决方案--------------------------------------------------------
$("#CheckPassword").val()="OK";
jquery赋值 方式为.val("OK");