使输入框读取,而不是选择和删除数据

时间:2015-09-23 13:08:08

标签: jquery-ui

您是否可以只在输入框中添加数据,但不能选择然后删除数据。

我应该如何在jQuery UI中执行此操作?

谢谢!



 $(function() {
    $( "#from").datepicker({
      showWeek: true,
      firstDay: 1,
      defaultDate: "+1w",
      changeMonth: true,
      numberOfMonths: 2,
      dateFormat: "yy-mm-dd",
      onClose: function( selectedDate ) {
        $( "#to" ).datepicker( "option", "minDate", selectedDate );
      }
    });
    

    $( "#to" ).datepicker({
      showWeek: true,
      firstDay: 1,      
      defaultDate: "+1w",
      changeMonth: true,
      numberOfMonths: 2,
      dateFormat: "yy-mm-dd",      
      onClose: function( selectedDate ) {
        $( "#from" ).datepicker( "option", "maxDate", selectedDate );
      }
    });
  });

  <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
  <script src="//code.jquery.com/jquery-1.10.2.js"></script>
  <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
  <link rel="stylesheet" href="/resources/demos/style.css">


  
<label for="from">From</label>
<input type="text" id="from" name="from">
<label for="to">to</label>
<input type="text" id="to" name="to">
&#13;
&#13;
&#13;

0 个答案:

没有答案