#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 12 years ago by
Component: | ui.core → ui.datepicker |
---|
comment:2 Changed 12 years ago by
comment:3 Changed 12 years ago by
Resolution: | → duplicate |
---|---|
Status: | new → closed |
comment:5 follow-up: 6 Changed 9 years ago by
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.
comment:6 Changed 9 years ago by
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:
- 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/.
This seems to be a duplicate of #5734