【问题标题】:Update multiple inputs with altField in Datepicker在 Datepicker 中使用 altField 更新多个输入
【发布时间】:2010-06-23 08:20:59
【问题描述】:

谁能告诉我修改以下内容的正确方法:

$("#datepicker01").datepicker({

  numberOfMonths: 2,
  minDate: dd, 
  maxDate: '+1M +31D',
  hideIfNoPrevNext: true,
  altField: 'input#chooseDate01',
  altFormat: 'DD, d MM yy',
  beforeShowDay: noWeekendsOrHolidays
 });

我需要在 altField 元素中再添加 5 个,即 'input#chooseDate02' 等。是不是很简单:

altField: 'input#chooseDate01' 'input#chooseDate02', and so on.

谢谢。

【问题讨论】:

    标签: jquery uidatepicker jquery-ui-datepicker


    【解决方案1】:

    altField 属性采用 jQuery 选择器,因此您可以这样做

    altField: 'input#chooseDate01, input#chooseDate02'
    

    http://api.jquery.com/multiple-selector/

    或者你可以只按类选择,例如

    altField: 'input.choose-date-class'
    

    【讨论】:

      猜你喜欢
      • 2016-06-14
      • 1970-01-01
      • 2010-11-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-09-23
      • 2012-02-13
      • 1970-01-01
      相关资源
      最近更新 更多