最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - jquery datepicker onselect not working - Stack Overflow

programmeradmin3浏览0评论

jquery function:

$(function() {
    $("#iDate").datepicker({
        dateFormat: 'dd MM yy',
        beforeShowDay: unavailable
    onSelect: function (dateText, inst) {
            $('#frmDate').submit();
        }

    });

});

html:

        <form id="frmDate" method="post" action="<?php echo $base_url;?>index.php">
<input id="iDate" name="iDate" class='input' type="text" />

it doesn't seem to be firing, don't understand why it is not working.

cheers.

jquery function:

$(function() {
    $("#iDate").datepicker({
        dateFormat: 'dd MM yy',
        beforeShowDay: unavailable
    onSelect: function (dateText, inst) {
            $('#frmDate').submit();
        }

    });

});

html:

        <form id="frmDate" method="post" action="<?php echo $base_url;?>index.php">
<input id="iDate" name="iDate" class='input' type="text" />

it doesn't seem to be firing, don't understand why it is not working.

cheers.

Share Improve this question asked Mar 29, 2012 at 15:06 bobo2000bobo2000 1,8777 gold badges34 silver badges54 bronze badges 2
  • Have you tried debugging it with the console? What errors do you get? – j08691 Commented Mar 29, 2012 at 15:07
  • use google chrome's console or firefox's firebug plugin to debug javascript – Vigrond Commented Mar 29, 2012 at 15:10
Add a ment  | 

2 Answers 2

Reset to default 6

You're missing a ma in your javascript:

$(function() {
    $("#iDate").datepicker({
        dateFormat: 'dd MM yy',
        beforeShowDay: unavailable,
        onSelect: function (dateText, inst) {
            $('#frmDate').submit();
        }
    });
});

Your jquery function is missing a ma

$(function() {
    $("#iDate").datepicker({
        dateFormat: 'dd MM yy',
        beforeShowDay: unavailable, <-- here :)
        onSelect: function (dateText, inst) {
            $('#frmDate').submit();
        }

    });

});
发布评论

评论列表(0)

  1. 暂无评论