Skip to main content

Search and Top Navigation

#6124 closed bug (duplicate)

Opened September 29, 2010 04:02PM UTC

Closed December 15, 2010 01:44PM UTC

Last modified January 20, 2014 02:03PM UTC

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.

Attachments (0)
Change History (6)

Changed October 01, 2010 06:51PM UTC by scottgonzalez comment:1

component: ui.coreui.datepicker

Changed December 15, 2010 01:43PM UTC by Guiles comment:2

This seems to be a duplicate of #5734

Changed December 15, 2010 01:44PM UTC by scottgonzalez comment:3

resolution: → duplicate
status: newclosed

Changed October 11, 2012 09:15PM UTC by scottgonzalez comment:4

milestone: TBD

Milestone TBD deleted

Changed January 19, 2014 09:37PM UTC by nealeu comment:5

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.

Changed January 20, 2014 02:03PM UTC by tj.vantoll comment:6

milestone: → none

Replying to [comment:5 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: - Go to http://jqueryui.com/demos/datepicker/#alt-field - Select a date - place the cursor in the date field - delete the characters (either one by one, or all at once) 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/.