2009-09-21 56 views
2

后消失得到了jQuery UI的日期选择器插件的非常棒,但是使用IE7时,日历不做出选择后,喜欢在FF,Safari浏览器等不消失。jQuery UI的日期选择器不会在IE7选择

这里的URL http://www.mchenry.edu/insideApp/OIRPprojectrequest/oirpprojectrequestform.aspx

我希望这是一些愚蠢的,“因为IE7是我需要为内部客户端支持的浏览器。

Thnx!

编辑:试试这个URL,http://www.mchenry.edu/test/oirpprojectrequestform.aspx

对不起“回合的!

+1

无法访问该网址 - HTTP错误403.6 - 禁止访问:客户端的IP地址已经拒绝。 – 2009-09-21 16:35:36

+0

您无权查看此页面 – mkoryak 2009-09-21 16:35:42

+1

您是否可以将相关代码复制到http://jsbin.com上? – 2009-09-21 16:35:55

回答

0

网页错误的详细信息

用户代理:Mozilla的/ 4.0(兼容; MSIE 8.0; Windows NT的5.1;三叉戟/ 4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)时间戳:星期一,2009年9月21日十八时50分51秒 UTC

消息: '长度' 是空或不是 对象行:139字符:17代码:0 URI: http://www.mchenry.edu/aspnet_client/system_web/1_1_4322/WebUIValidation.js

event.srcElement.Validatorsundefined当我一步一步与IE8。你的意思是在DispHTMLAnchorElement上访问Validators

+0

我在这里也使用验证插件。你认为这可能是两者之间的冲突吗?除非这是一个简单的解决方案,否则我可能不得不抛弃其中一个。不知道客户端验证有多重要,因为它是一个内部应用程序,我们也有服务器端检查。嗯... – Jesse 2009-09-21 19:09:08

+0

说明:我使用jQuery验证插件 - 我们的后端.Net大师想要使用。网上验证果汁,但我禁用了她的诡计。 – Jesse 2009-09-21 19:19:09

+0

良好的验证应该在表单元素上;这里是在一个主播,事件源上进行的。 – geowa4 2009-09-21 20:20:22

1

如果你有这样的事情在你的日期选择器设置:

ONSELECT:函数(){this.focus(); } onClose:function(){this.focus(); }

这会导致元素被赋予焦点,并由验证器插件进行验证。

不幸的是,在IE7中,这会导致为重点事件被称为两次错误和日期选择器会产生混乱而再次弹出。

的解决方案是不显式调用验证器的元件上,然后将焦点移动到下一个元素的IE以保留的标签顺序。

   onSelect: function() { 
        var elementCounter, input, form; 
        input = $(this); 
        form = input.parents('form:first'); 

        // validate the selected date 
        form.validate().element(this); 

        if ($.browser.msie && $.browser.version < 8) { 
         // MSIE 7 triggers focus event twice, forcing the datepicker to re-open 
         // to get around this, we move the focus to the next form element 

         for (var elementCounter = 0; elementCounter < form[0].elements.length; elementCounter++){ 
          if (form[0].elements[elementCounter].name == input.attr('name')) { 
           $(form[0].elements[elementCounter+1]).focus(); 
           break; 
          } 
         } 
        } else { 
         // give focus back to the input element to preserve tabbing 
         $(this).trigger('focus'); 
        } 
       }, 
       onClose: function() { 

        // validate the selected date 
        $(this).parents('form:first').validate().element(this); 

       } 
+0

当我在IE9/IE7mode中运行此代码时,我在'form [0]'上得到了一个nullref错误。 – jcollum 2011-04-17 19:42:09

0

如果您可以指定在输入字段的tabindex属性,那么这可能会为你工作得很好:

onClose: function() { 
    $('input[tabindex="' + ($(this).attr('tabindex') + 1) + '"]').focus(); 
}