user1241924
user1241924

Reputation: 11

Using jQuery Date picker with name instead of id in struts application

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

Answers (1)

Sudhir Bastakoti
Sudhir Bastakoti

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

Related Questions