el selector de fecha no aparece cuando el cursor se coloca en el cuadro de texto

I have two date pickers appearing when green color is clicked, but when i am putting mouse cursor on those two text boxes, then nothing appears, only after clicking image/green color date picker is appearing. What modification should i do?

In this below fiddle automatically date picker is appearing when cursor is put:


I want to add the above function in below fiddle:


I am trying but nothing happens. Any solution please


preguntado el 03 de mayo de 12 a las 10:05

@Gavriel is right, but the datepicker you are using is slightly buggy and definitely outdated (3 years old). Use mootools.net/forge/p/mootools_datepicker -

2 Respuestas

The code in the two examples are different. Try to set up an example that is more like your real code. Try to do the same thing in the 2nd example:

new DatePicker('.picker', {
     pickerClass: 'picker ',
    allowEmpty: true

contestado el 03 de mayo de 12 a las 10:05

I know, I tried it too, that's why I told you to make 2 identical examples, 'cause it's hard to do anything like this - Gavriel

aquí está: jsbin.com/uzagil/edit#javascript,html,live but i am facing a problem that i have given comment in Codrin's answer, any solution please - saroj

that's because you think you have first and second, but looking into your code you see that the two are identical: same id, same class, etc. How do you think datepicker should guess which green div belongs to which input field? - Gavriel

ya that's the solution i need, any idea please - saroj

@saroj The initial Gavriel solution is correct, it's the datapicker you are using that is a bit buggy (if you click on one input, then click somewhere else, then click on the other input it works; instead clicking from one input to the other does not work as expected). His latest solution works, but I strongly suggest you switch to the official selector de fecha mootools - Stefano

Añadir un click event on the textboxes:

$$('.date').addEvent('click', function() { 

contestado el 03 de mayo de 12 a las 10:05

thanks for your answer but i found that when i clicked 2nd green color, then choosed date from date picker and entered the date in 2nd text box, now when i put my cursor on 1st text box then datepicker appeared but when i choosed date , date is entered into 2nd text box, instead of going to 1st text box. Please check it once - saroj

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.