Skip to main content

Search and Top Navigation

#9202 open bug ()

Opened April 02, 2013 09:11PM UTC

Last modified April 03, 2013 02:59PM UTC

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.

Attachments (0)
Change History (3)

Changed April 02, 2013 11:41PM UTC by scottgonzalez comment:1

owner: → 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?

Changed April 03, 2013 02:41PM UTC by dparpyani comment:2

status: pendingnew

Replying to [comment:1 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.

Changed April 03, 2013 02:59PM UTC by scottgonzalez comment:3

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.