jquery - How to use datepicker Dynamically -



jquery - How to use datepicker Dynamically -

i have input boxes, how can utilize datepicker dynamically

<input type="text" id="datepicker" name="date[0]"> <input type="text" id="datepicker" name="date[1]"> <input type="text" id="datepicker" name="date[2]"> <input type="text" id="datepicker" name="date[3]">

i tried code wont work first input changes

$('name^="date"').datepicker({ dateformat: 'yy-mm-dd', changemonth: true, changeyear: true })

i want code dynamically not

$('#datepicker1').datepicker({}) $('#datepicker2').datepicker({})....

is possible? reply.

for case should utilize class instead of id:

<input type="text" class="datepicker" name="date[0]"> <input type="text" class="datepicker" name="date[1]"> <input type="text" class="datepicker" name="date[2]"> <input type="text" class="datepicker" name="date[3]">

then can phone call datepicker every element class:

$('.datepicker').datepicker({ dateformat: 'yy-mm-dd', changemonth: true, changeyear: true })

jquery jquery-ui jquery-ui-datepicker

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -