Opened 9 years ago

Closed 7 years ago

#5734 closed bug (notabug)

The altField is not updated when a null date is specified

Reported by: russell Owned by:
Priority: major Milestone: 1.11.0
Component: ui.datepicker Version: 1.8.2
Keywords: futurescott Cc:
Blocked by: Blocking:

Description

Setup a datepicker with an altField & altFormat. Then empty the date field and tab out. The altField is not updated.

Change History (6)

comment:1 Changed 9 years ago by russell

to get around the problem I had to do this :

    onClose: function(dateText, inst) {
      if(dateText == '') {
        $(inst.settings["altField"]).val(dateText);
      }
    }

comment:2 in reply to:  1 Changed 9 years ago by 17dufa

Replying to russell:

Hello, can you post more detailed solving code? because I don't understand where I need to insert this function. And there is one more question: what about situation when user close datepicker dialog and then clear input field by keyboard?

to get around the problem I had to do this :

    onClose: function(dateText, inst) {
      if(dateText == '') {
        $(inst.settings["altField"]).val(dateText);
      }
    }

Last edited 9 years ago by 17dufa (previous) (diff)

comment:3 Changed 9 years ago by russell

I used this code snippet in initialization, I don't have an actual fix.

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

Milestone: TBD1.11.0

comment:5 Changed 7 years ago by mikesherov

comment:6 Changed 7 years ago by mikesherov

Keywords: futurescott added
Resolution: notabug
Status: newclosed

Thanks for contributing! This is not really a bug but a feature. altField does not update when an invalid date is present. This API is being redesigned in the future. Ask future scott about if you're curious!

Note: See TracTickets for help on using tickets.