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

maven fortify plugin : Unable to load build session with ID XXXXX .. See log file for more details -

c# - Primavera WebServices does not return any data -

android - Display emoji panel with genymotion - keyboard/touch input? -