【发布时间】:2016-03-04 11:12:48
【问题描述】:
这里: http://api.jqueryui.com/datepicker/ 我明白了:
键盘交互
当日期选择器打开时,以下关键命令是 可用:
PAGE UP: Move to the previous month. PAGE DOWN: Move to the next month. CTRL + PAGE UP: Move to the previous year. CTRL + PAGE DOWN: Move to the next year. CTRL + HOME: Open the datepicker if closed. CTRL/COMMAND + HOME: Move to the current month. CTRL/COMMAND + LEFT: Move to the previous day. CTRL/COMMAND + RIGHT: Move to the next day. CTRL/COMMAND + UP: Move to the previous week. CTRL/COMMAND + DOWN: Move the next week. ENTER: Select the focused date. CTRL/COMMAND + END: Close the datepicker and erase the date. ESCAPE: Close the datepicker without selection.
我不想要:
ENTER:选择焦点日期。
互动
是否可以禁用单个交互?我在特定字段中的 Enter 键不得在我的字段中设置日期。我的 Enter 键必须在该字段中执行其他操作(确实如此),只是不想在该字段中设置日期。
【问题讨论】:
-
尝试添加
$('.className').on('keypress', function(e) { if(e.keyCode == 13) { return false; } });
标签: javascript jquery html jquery-ui datapicker