Reputation: 11
I want to use jquery datepicker plugin in struts .can anyone help me in this regard i have id for date picker but i want to populate using name or struts equivalent i want to populate using name intsead of id .please help me in this regard
<input name="ADate" id="datepicker" type="text" class="txtBox">
<script>
$(function() {
$( "#datepicker" ).datepicker({
changeMonth: true,
changeYear: true,
dateFormat: 'yy-mm-dd',
});
});
</script>
Upvotes: 1
Views: 4332
Reputation: 100175
Try:
$(document).ready(function() {
$( "input[name='ADate']" ).datepicker({
changeMonth: true,
changeYear: true,
dateFormat: 'yy-mm-dd'
});
});
Did you mean something like that
Upvotes: 4