Update textBox with more than 1 date from JQuery Calendar

Discussion in 'jQuery' started by xna4life, Dec 4, 2012.

  1. #1
    So i've used a DateTime textbox to allow the user to enter a date and click create, it will add this date to the DB.
    This works fine, So i've added a Jquery datePicker calendar to select multiple dates, (which works) but when I close the calendar it only adds the last selected date to the DateTime text box....
    How can I go about where it will add all of the dates to the text box and save them to the DB?
    So Im using:

    <script>
    $("#HolidayDate").addClass('date-pick');
    $('.date-pick').datePicker({createButton: false,displayClose: true,closeOnSelect: false,selectMultiple: true}).


    .bind('click',function () {$(this).dpDisplay();this.blur();return false;}).
    .bind('dateSelected',function (e, selectedDate, $td, state) {console.log('You ' + (state ? '' : 'un') // wrap+ 'selected ' + selectedDate);})
    .bind('dpClosed',function (e, selectedDates) {console.log('You closed the date picker and the ' // wrap+ 'currently selected dates re:');console.log(selectedDates);});

    </script>

    from the website... http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/index.html[^]

    Thanks J
     
    xna4life, Dec 4, 2012 IP