2014-01-30 30 views
1

嗨朋友我是新的intel XDK如何防止在intel XDK中的输入文本上打开键盘?

我的代码: -

<html> 
<head> 

    <link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css"> 
    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.0/jquery.mobile-1.4.0.min.css"> 
    <script src="//code.jquery.com/jquery-1.9.1.js"></script> 
    <script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script> 
    <script src="http://code.jquery.com/mobile/1.4.0/jquery.mobile-1.4.0.min.js"></script> 

<script> 

    $(function() { 
     $("#txt_date").datepicker({ 
     changeMonth: true, 
     changeYear: true 
    }); 
    }); 
</script> 
</head> 
<body> 

    <input type="text" name="text-date" id="txt_date" value="" readonly="true" > 

</body> 
</html> 

我试过也只读输入文本的属性,但我不解决我的问题。

问题:

这里我的问题是,当我点击输入文本,然后我得到精细Jquery Datepicker但随着Datepicker我也得到Keyboard我的手机device.So如果有人有这个问题的解决方案,以便请帮帮我。

在此先感谢!

回答

0

我想你应该走这条路:

$(function() { 
     $("#txt_date").keypress(function(event) { 
       event.preventDefault(); 
     }); 

    $("#txt_date").datepicker({ 
     changeMonth: true, 
     changeYear: true 
    }); 
    }); 
+1

谢谢哥们这是工作.. –

+0

快乐与英特尔XDK新编码... !!!! –