A
A
andreyqin2015-04-27 15:39:05
Google Chrome
andreyqin, 2015-04-27 15:39:05

Why doesn't the calendar open when switching from input type="text" to input type="date"?

Hello.
Since the placeholder does not work for the input with the date type, I used a hack: initially the field has the text type, and when the focus becomes date. But the problem is that in the mobile version of Chrome, with focus, the calendar opens only on the second click. That is, as I understand it, at the first click it changes the type and only at the second it opens the calendar. I tried it in UC and Safari - everything is ok, it works the way I need it. How can this problem be corrected?
Example - jsfiddle.net/1t00qour

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
sim3x, 2015-04-27
@andreyqin

$(this).attr('type', 'date').click()?

E
Evgeny Petrov, 2015-04-27
@Petroveg

You can experiment with the generation of focus , click events, as sim3x has already mentioned .
You can try not to change the type of the field, but simply hide and show it as needed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question