You must Sign In to post a response.
  • Category: ASP.Net MVC

    Event on date selection in JQuery

    Hi.
    I have below code on form,

    <div>
    <div class='input-group date' id='datetimepicker2'>
    <input type='text' class="form-control" />
    <span class="input-group-addon">
    <span class="glyphicon glyphicon-calendar"></span>
    </span>
    </div>
    </div>

    Here, I want to write a code in controller which should call through Ajax in mvc5 on "datetimepicker2" date selection.
  • #768296
    jQuery UI Calendar provides an event "onSelect" which is use to select the date. You need to use this code snippet to date selection in JQuery

    $(function()
    {
    $('#txtDate').datepicker({ onSelect:
    function(dt)
    {
    window.open("http://www.google.com?dt=" + dt);
    }
    });
    });

  • #768311
    Hi,

    Use JQuery Datepicker plugin which has lots of additional features.
    Like you can select date along with current time, date with month alone and date with different formats like DD/MM/YYYY or MM/DD/YYYY etc.,



    $.datepicker.setDefaults( options )



    in options area, we can modify the functionality or behavior of the date field.


    $.datepicker.formatDate( format, date, options )


    in this option we can specify the format and date.

    Thanks,
    Mani


  • Sign In to post your comments