Opened 9 years ago

Closed 9 years ago

Last modified 6 years ago

#6124 closed bug (duplicate)

altField doesn't clear when primary field is manually cleared

Reported by: aaronbarker Owned by:
Priority: major Milestone: none
Component: ui.datepicker Version: 1.8.5
Keywords: Cc:
Blocked by: Blocking:

Description

This can be seen on the jQuery UI demo page http://jqueryui.com/demos/datepicker/#alt-field

If you select a date (or type one in) it will populate the alternate field. If you manually remove the date in the primary field, the alternate field stays populated.

This can be very problematic when the primary field is for show and the alternate is what is actually used for submission.

The script should clear the alternate field when the primary field is cleared.

Change History (6)

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

Component: ui.coreui.datepicker

comment:2 Changed 9 years ago by Guiles

This seems to be a duplicate of #5734

comment:3 Changed 9 years ago by Scott González

Resolution: duplicate
Status: newclosed

comment:4 Changed 7 years ago by Scott González

Milestone: TBD

Milestone TBD deleted

comment:5 Changed 6 years ago by nealeu

Please reopen.

The ticket was marked a duplicate, but the other ticket closed due to misunderstanding.

The test scenario in this ticket remains valid:

The result is that if you enter 08/08/2014, and then delete the text from the end (i.e. deleting the 4, then the 1), then the altField value updates to 08/08/201, then 08/08/2020, then the final value is 08/08/2002.

Beyond this, deleting the 2, such that the date reads 08/08/ should clear the altField as this is an invalid value. If both fields start empty, and I type 08/08/ then, no value appears in the altField.

comment:6 in reply to:  5 Changed 6 years ago by tj.vantoll

Milestone: none

Replying to nealeu:

Please reopen.

The ticket was marked a duplicate, but the other ticket closed due to misunderstanding.

The test scenario in this ticket remains valid:

The result is that if you enter 08/08/2014, and then delete the text from the end (i.e. deleting the 4, then the 1), then the altField value updates to 08/08/201, then 08/08/2020, then the final value is 08/08/2002.

Beyond this, deleting the 2, such that the date reads 08/08/ should clear the altField as this is an invalid value. If both fields start empty, and I type 08/08/ then, no value appears in the altField.

To quote from #6124: "This is not really a bug but a feature. altField does not update when an invalid date is present."; therefore this is a duplicate.

If you want this behavior, you can easily add it yourself: http://jsfiddle.net/tj_vantoll/au9v5/.

Note: See TracTickets for help on using tickets.