Ipad +如何防止键盘在jquery datepicker上弹出 [英] Ipad + How to prevent the keyboard from popping up on jquery datepicker
问题描述
我想从我的Ipad中禁用键盘弹出窗口,所以我做了类似的事情,但这不是我的愿望。
I want to disable the keyboard popup from my Ipad so I do something like this, but it's not as my wish.
我有一个文本框:
<h:inputText id="txtDate" value="#{myDateController.selected.DOB}"
我尝试使用readonly属性,但数据无法保存到数据库。
我也使用这个:$(#frmEdit \:txtDate)。attr(disabled,true) - >但是没关系
I try to use "readonly" attribute but data can not save to the Database. I also use this: $("#frmEdit\:txtDate").attr("disabled", true) --> but it's not ok
我在网上搜索并使用此链接应用我的代码,但它也不行: ipad web应用程序:如何防止键盘弹出jquery datepicker
I searched on the web and applied my code with this link, but it's also not ok: ipad web application: How do I prevent the keyboard from popping up on jquery datepicker
$(function() {
//$("#frmEdit\\:txtDate").attr("disabled", true)
$("#frmEdit\\:txtDate").datetimepicker({
// showOn: "button"
showOn: "both",
buttonImage: "../images/calendar.png",
buttonImageOnly: true,
constrainInput: true,
showButtonPanel: true,
dateFormat: 'dd-M-yy',
addSliderAccess: true,
sliderAccessArgs: { touchonly: false },
onClose: function(dateText, inst){
$(this).attr("disabled", false);
},
beforeShow: function(input, inst){
$(this).attr("disabled", false);
}
});
});
我的代码出了什么问题?或任何其他解决方案吗?
非常感谢
What's wrong with my code ? or any other solution to do ? Many Thanks
推荐答案
您是否尝试过使用HTML禁用输入字段(因此添加已禁用=禁用
)?
Have you tried disabling the input field using HTML (so adding disabled="disabled"
)?
这篇关于Ipad +如何防止键盘在jquery datepicker上弹出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!