Update multiple inputs with altField in Datepicker

Can someone please tell me the correct way to change the following:

$("#datepicker01").datepicker({

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

I need to add 5 more to the altField element, that is, "input # chooseDate02", etc. It is as simple as:

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

Thank.

+3
source share
1 answer

the altField attribute accepts a jQuery selector, so you can do it

altField: 'input#chooseDate01, input#chooseDate02'

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

or you can just select a class, for example.

altField: 'input.choose-date-class'
+1
source

Source: https://habr.com/ru/post/1751345/


All Articles