为什么  input的 onfouse 和 onblur  为什么有时候用不了  ??  我前段时间做完测试还是可以弄的  但是今天重新试了下  发下就用不了??                   <input ID="TxteachID" runat="server" 
                     onblur="topicApply_teachID_check(); document.getElementById('topicApply_teachID_Stat').className = 'tip_off'" 
                     onfocus="document.getElementById('topicApply_teachID_Stat').className = 'tip_on '" 
                     type="text" />
                 <input ID="TxteachName" runat="server" 
                     onblur="topicApply_teachName_check(); document.getElementById('topicApply_teachName_Stat').className = 'tip_off'" 
                     onfocus="document.getElementById('topicApply_teachName_Stat').className = 'tip_on '" 
                     type="text" />这里的 onblur属性就是触发不了!!!!! 
   

解决方案 »

  1.   

    触发是肯定可以触发的,检查你写的js。
    topicApply_teachID_check();   这个里面的内容?
      

  2.   

    检查了  这个函数是出发不了的 我在里面加了alert() ; 但是没有任何反应
      

  3.   


    JS
         //工号检验
         function topicApply_teachID_check()
         {
            var id= document.getElementById('TxteachID').value;
            if( id == null || id == "")
            {
              document.getElementById('topicApply_teachID_Stat').innerHTML = "<font color = red>"+TopicApply_TeachID_IsNull + "</font>";
              return;
            }
            
            
            var url = "server/apply_check.aspx?action=teach_id&id="+ escape(id)+"&time=" + Math.random();
              
            TunnelRequest.Get( url,topicApply_teachID_check_Callback);
         }HTML
              <tr>
                 <td class="style2"><span>教师工号</span>
                 </td>
                 <td class="style4">
                     <input ID="TxteachID" runat="server" 
                         onblur="topicApply_teachID_check(); document.getElementById('topicApply_teachID_Stat').className = 'tip_off'" 
                         onfocus="document.getElementById('topicApply_teachID_Stat').className = 'tip_on '" 
                         type="text" />&nbsp;</td>
                <td id="topicApply_teachID_Stat" class=" tip_off"></td>
              </tr>
      

  4.   

    是可以触发的!
    提示:TopicApply_TeachID_IsNull没定义!!
      

  5.   

    代码看起来没问题,你用ff的firebug看下哪里出错。
      

  6.   

    事件是绝对触发了,你alert是加到哪里了,这样加看看:
     <input ID="TxteachID" runat="server" 
                         onblur="alert('ceshi');topicApply_teachID_check(); document.getElementById('topicApply_teachID_Stat').className = 'tip_off'" 
                         onfocus="alert('ceshi');document.getElementById('topicApply_teachID_Stat').className = 'tip_on '" 
                         type="text" />&nbsp;