Jquery datepicker抛出过多的递归错误

时间:2011-03-31 05:09:14

标签: jquery-ui button datepicker

我试图用完成按钮修改jquery datepicker作为清除按钮。但它抛出了太多的递归错误...... 我的代码是,

function datePickerToCompareTwoFields(){
    var dformat = document.getElementById('dateFormat').value;
    $( '#popup_container, #popup_container1' ).datepicker({
        beforeShow: customRange,
        changeMonth: true,
        changeYear: true,
        closeText: 'Clear',
        dateFormat: dformat,
        numberOfMonths: 2,
        selectOtherMonths: true,
        showButtonPanel: true,
        showOtherMonths: true
    });
    $.datepicker._generateHTML_Old = $.datepicker._generateHTML;
    $.datepicker._generateHTML = function(inst) {
        res = this._generateHTML_Old(inst); 
        res = res.replace("_hideDatepicker()","_clearDate('#"+inst.id+"')");
        return res;
    }
}

0 个答案:

没有答案