Opened 7 years ago

Last modified 7 years ago

#9202 open bug

Datepicker: Indicate if user enters invalid date.

Reported by: dparpyani Owned by: dparpyani
Priority: minor Milestone: none
Component: ui.datepicker Version: 1.9.2
Keywords: Cc:
Blocked by: Blocking:

Description

Hello,

To my knowledge, there is no indication when a user enters an invalid date in an datepicker input field. The alternate field does not get updated (and continues to store previous date) when gibberish text is entered in the datepicker input field. This leaves inconsistency between the hidden field and the datepicker input field.

To reproduce (http://jsfiddle.net/QzCDh/5/):

  • Select valid date for the datepicker input. Alternate field should display selected date.
  • Now replace the selected date with gibberish text. This leaves the previously selected value in the alternate field.

Clearing out the hidden field would be an expected result.

After looking around a little, it seems like the change should occur in the following place, although I may be wrong:

https://github.com/jquery/jquery-ui/blob/master/ui/jquery.ui.datepicker.js#L689

Let me know what you think.

Change History (3)

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

Owner: set to dparpyani
Status: newpending

So to clarify: You don't actually want an indication of invalid dates, you just want the alt field cleared if an invalid date is entered, correct?

comment:2 in reply to:  1 Changed 7 years ago by dparpyani

Status: pendingnew

Replying to scott.gonzalez:

So to clarify: You don't actually want an indication of invalid dates, you just want the alt field cleared if an invalid date is entered, correct?


Ideally, both would be nice to have:

  • Clearing the altField when an invalid date is entered.
  • An indication of invalid dates, which could be further divided into:
    • An indication to the user.
    • A way for us to find out when the user has entered an invalid date.

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

Status: newopen
Summary: Indicate if user enters invalid date.Datepicker: Indicate if user enters invalid date.

This should just be handled the same way as autocomplete or spinner with a change event.

Note: See TracTickets for help on using tickets.