如图,如果三个input都没有填,点击提交会出现三个提示,并且第一个input获得焦点,然后填完第一个,提交,后面两个input会提示不能为空,第二个input获得焦点,然后把第二个input填完,再点击提交,这时候,bug出来了,页面死了!!!!卡死了,完全动不了,第二个input后面的标签不消失,第三个input也不获得焦点,这个问题怎么解决啊,或者有没有更好的解决办法,适用所有的浏览器(主流的),
现在用的是谷歌内核的浏览器有问题,但是用ie暂时没有发现问题,运行完好。要兼容谷歌ie火狐safari等主流浏览器(主要兼容谷歌内核的),求大神帮忙看下,小弟不甚感激,先谢过了我的html代买如下
<table>
    <tr>
        <td>
            <input type="text" class="notnull" />
            <span style="display: none;"><b style="color: red;">*</b>日期不能为空</span>
        </td>
    </tr>
    <tr>
        <td>
            <input type="text" class="notnull" />
            <span style="display: none;"><b style="color: red;">*</b>时间不能为空</span>
        </td>
    </tr>
    <tr>
        <td>
            <input  type="text" class="Wdate notnull" onfocus="WdatePicker()" />
            <span style="display: none;"><b style="color: red;">*</b>最后不能为空</span>
        </td>
    </tr>
</table>
<button id="aa">提交</button>
@Scripts.Render( "~/Scripts/My97DatePicker/WdatePicker.js" )
@Scripts.Render( "~/Scripts/Home/Home.js" )
写的是mvc架构,后面的是引用js,也可以直接加标签<script>引用js,下面是我写的js,
$(function () {
    $('#aa').click(function () {
        Valid();
    });
});
function Valid() {
    var IsFocus = false;
    $('.notnull').each(function () {
        var $_this = $(this);
        var _value = $_this.val().replace(/\s/g, "");
        if (_value == "") {
            $_this.next().css("display", "");
            if (!IsFocus) {
                $_this.focus();
                IsFocus = true;
            }
        }
        else {
            $(this).next().css("display", "none");
        }
    });
}