date picker not appearing when cursor is put in textbox

安稳与你 提交于 2019-12-13 20:44:25

问题


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:

http://jsfiddle.net/cBwEK/

I want to add the above function in below fiddle:

http://jsbin.com/unosar/19/edit#javascript,html,live

I am trying but nothing happens. Any solution please

EDIT: BOTH THESE ABOVE EXAMPLES USE SAME css/js/mootools SCRIPTS


回答1:


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
});




回答2:


Add an click event on the textboxes:

$$('.date').addEvent('click', function() { 
      dp.show(); 
});


来源:https://stackoverflow.com/questions/10428513/date-picker-not-appearing-when-cursor-is-put-in-textbox

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!