質問

Hi Friends I am new with intel XDK.

My Code :-

<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>

I Tried also read only property of input text but I could not solved My problem.

Problem :

Here My problem is that when I click on input text then I get fine Jquery Datepicker.But with Datepicker I also get Keyboard on my mobile device.So if somebody have solution of this problem so please help me.

Thanks in Advance!!

役に立ちましたか?

解決

I think you should go this way:

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

    $( "#txt_date" ).datepicker({
      changeMonth: true,
      changeYear: true
    });
  });
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top