1

我添加到页面的 jQuery 日期选择器在 IE 9 和 Firefox 18 中按预期工作,但在 Google Chrome 24 中选择日期后不会关闭。

这是我正在使用的 jQuery 代码:

    $(function() {
        $( "#fromCheck" ).datepicker({
            defaultDate: "-1w",
            maxDate: "+0",
            changeMonth: true,
            numberOfMonths: 1,
            showButtonPanel: false,
            onClose: function( selectedDate ) {
                $( "#toCheck" ).datepicker( "option", "minDate", selectedDate || "-1w" );
            }
        });
        $( "#toCheck" ).datepicker({
            defaultDate: "+0",
            maxDate: "+0",
            changeMonth: true,
            numberOfMonths: 1,
            showButtonPanel: false,
            onClose: function( selectedDate ) {
                $( "#fromCheck" ).datepicker( "option", "maxDate", selectedDate || "+0" );
            }
        });
        $( "#fromCard" ).datepicker({
            defaultDate: "-1w",
            maxDate: "+0",
            changeMonth: true,
            numberOfMonths: 1,
            showButtonPanel: false,
            onClose: function( selectedDate ) {
                $( "#toCard" ).datepicker( "option", "minDate", selectedDate || "-1w" );
            }
        });
        $( "#toCard" ).datepicker({
            defaultDate: "+0",
            maxDate: "+0",
            changeMonth: true,
            numberOfMonths: 1,
            showButtonPanel: false,
            onClose: function( selectedDate ) {
                $( "#fromCard" ).datepicker( "option", "maxDate", selectedDate || "+0" );
            }
        });
    });

这是演示页面的链接:

http://www.tempuspayment.com/paymentmate/tests/apm/

4

1 回答 1

0

您在第 136 行抛出一个 javascript 错误,该错误会停止执行您的 Javascript。

违规行是:

<input name="FROMDATE" type="text" id="fromCheck" value="01/04/2013" onfocus="value='" size="10" maxlength="50" />

应该是:

<input name="FROMDATE" type="text" id="fromCheck" value="01/04/2013" onfocus="value=" size="10" maxlength="50" />
于 2013-01-17T17:24:56.613 回答