Opened 14 years ago

Closed 14 years ago

Last modified 13 years ago

#3861 closed bug (fixed)

Manually entered date do not update altField

Reported by: mdiaz Owned by:
Priority: major Milestone: 1.8
Component: ui.datepicker Version: 1.6rc5
Keywords: Cc:
Blocked by: Blocking:

Description

If a date is typed in the field (instead of selected from the calendar widget) the altField value is not updated.

A workaround to this problem:

$("#datepickerFieldId").change(function(){

var widget = $.data(this, "datepicker"); $.datepicker._setDateFromField(widget); $.datepicker._updateAlternate(widget);

});

But this should be implemented in the widget itself.

The keyup event could be used instead of the change event so the updated value would still be submitted if the user clicks the submit button without removing focus from the datepicker field.

Attachments (2)

3861_unit.datepicker_options.js (855 bytes) - added by cfrerebeau 14 years ago.
patch adding the unit test
3861.ui.datepicker.js (1.5 KB) - added by cfrerebeau 14 years ago.
patch

Download all attachments as: .zip

Change History (7)

comment:1 Changed 14 years ago by Scott González

Milestone: TBD1.6

comment:2 Changed 14 years ago by kbwood

The problem with using the keyUp event is that most of the time you would not have a complete date to work with.

comment:3 Changed 14 years ago by rdworth

Milestone: 1.71.8

comment:4 Changed 14 years ago by cfrerebeau

Implemented the change with the keyUp event. Although to avoid the side effect mention, it verifies if the date is valid before to update it.

Added also the code to update the datepicker if a valid date is typed by the user. It seems to make sense which that type of behavior.

It is my first patch for jquery, so please don't hesitate to let me know if you have any feedback.

Changed 14 years ago by cfrerebeau

patch adding the unit test

Changed 14 years ago by cfrerebeau

Attachment: 3861.ui.datepicker.js added

patch

comment:5 Changed 14 years ago by kbwood

Resolution: fixed
Status: newclosed

Fixed in r2460.

Note: See TracTickets for help on using tickets.