3

I have a calendar picker working using jqueryUI but wanted to try to convert it to the native date picker.

i'd like to be able to have the following:

  1. start with the "< input id="nativedate" type="date"/>" element being hidden from the view.
  2. when the main page element is clicked, have the < input > element show, with the calendar opened
  3. when the user selecs a date on the calendar, the element is hidden.

Right now when i get to step 2, the < input > item is showing but with the calendar hidden, so the user must click to have the element appear and then click again to have the calendar show and then a third click to select the date.

EDIT: I've tried the following:

$('#nativedate').click(function(){
    console.log('click logged');
})

and then in another method:

$(#nativedate).trigger('click');

which works in terms of my event handler i've set up, but it does not open the calendar

4

1 回答 1

-1

一些问题:



i) 浏览器的本机日期时间元素是正在打开还是您的日历在输入 decleration 时打开?
ii)如果您的项目在一段时间后没有显示,那么尝试一些 javascript 来强制它在该特定输入标签附近保持打开状态?

这些可能会有所帮助


在 Google Chrome 中禁用本机日期选择器
从 Google Chrome v20 中的日期输入中删除背景箭头


或尝试 Google 搜索,或者您可以使用 CSS 编辑浏览器本机日期时间选择器。

于 2013-04-06T07:09:30.190 回答