$(function(){
$("txtVerifyCode").bind("blur",function(){

var imageCode = $("#imageCode").val();

$.ajax({url:"checkImage.action?imageCode="+imageCode,
type:"get",
dateType:"json",
success:function(obj){
//alert(obj);
if(obj.ok){
   $("#number.info.ok").val() ="√输入正确";
}else{
    $("#number.info").val() ="*输入错误";
}
}});
})

});

解决方案 »

  1.   

    <td valign="top" class="w1">
    验证码:
    </td>
    <td>
    <img class="yzm_img" id='imgVcode' src="user/imageCode" />
    <s:textfield name="user.imageCode" id="txtVerifyCode"
    cssClass="yzm_input" onblur="validateCheckImageCode();"/>

    <div class="text_left t1">
    <p class="t1">
    <span id="vcodeValidMsg">请输入图片中的四个字母。</span>
    <a href="javascript:;"
    onclick="document.getElementById('imgVcode').src='user/imageCode?'+(new Date().getTime());">看不清楚?换个图片</a>
    </p>
    <span id="number.info" style="color: red"></span>
    <span id="number.info.ok" style="color:blue"></span>
    </div>
    </td>验证码的验证怎么不能验证啊    哪位大虾帮帮忙!!!
      

  2.   

    问题在哪里??以下只是我整理一下你的代码方便我看
    $(function(){
    $("txtVerifyCode").bind("blur",function(){ var imageCode = $("#imageCode").val(); $.ajax({
    url:"checkImage.action?imageCode="+imageCode,
    type:"get",
    dateType:"json",
    success:function(obj){
    //alert(obj);
    if(obj.ok){
    $("#number.info.ok").val() ="√输入正确";
    }else{
    $("#number.info").val() ="*输入错误";
    }
    }});
    })
    });
      

  3.   


      $(function(){
        $("txtVerifyCode").bind("blur",function(){        var imageCode = $("#imageCode").val();        $.ajax({
            url:"checkImage.action?imageCode="+imageCode,
            type:"get",
            dateType:"json",
            success:function(obj){
            //alert(obj);
                if(obj.ok){
                    $("#number.info.ok").val() ="√输入正确";   //笔误? $("#number.info.ok").val("√输入正确")
                }else{
                    $("#number.info").val() ="*输入错误";  //笔误? $("#number.info").val("*输入错误");
                }
            }});
        })
    });