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

    Event on date selection in JQuery

    I have below code on form,

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

    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

    $('#txtDate').datepicker({ onSelect:
    {"" + dt);

  • #768311

    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.


  • Sign In to post your comments