After a user selects a date via datepicker he/she continue to type something after the date. Thus, it's very desirable to make the datepicker date selection screen disappear upon selection. Doable? The doc is not obvious on this. If so, how?
Well, indeed upon selection it disappears but since I or my user needs to continue to type to input additional data into the same field, I or my users need to re-focus the field and the datepicker shows up again, that's something I'd like not to see. Sorry I wasn't clear enough.
For instance, I selected date of 4/10/2017 and I'd like to add data, "wow a great day", thus, the value of
myField would end up like " 4/10/2017,wow a great day". While I typing in "wow a great day" I don't need nor want to see datepicker.
You are really asking for trouble by using a field for a datepicker and then having the user add additional text in the same field! Not only technical trouble, but it seems to me this will confuse the user.
But if you insist, you might disable the datepicker after the first time it is used. The user wouldn't be able to change the date after an initial selection, then, other than by manually typing the change.
I think it would be better to keep the date and notes (or whatever) in separate fields.
Is there some good reason for this odd design?
If you need them combined, for example, because you have a server that expects to get a submission with the date and notes in the same field, that can be easily accomplished.
@watusiware, I agree with your statement, it's what my client is asking for. I suspect the client may have some trouble of spelling month like January or February because they like the date format of April 13, 2017, thus, as a way to avoid month typo, but again when we use datepicker, a user could easily make one mistake among the three selections of month, day and year when in a hurry.
I just noticed something, that is, when the date picker shows up again, the ESC key would turn it away, thus, a thought is to simulate the ESC key press to turn it off. Ran a quick search for this key activation automatically, only get keyCode 27 for it, but not js code to execute keyCode 27.