tags:

views:

36

answers:

1

hey guys, m using JQuery UI Datepicker for my form and my script is like below

<script type="text/javascript">
    $(function() {
          $("#<%=txtExpiryDate.ClientID %>").datepicker({changeYear:"true"});
    });
</script>

But this shows only Month selection as prev/next button but i want Year selection also so i use'd .datepicker(changeYear:"true") but this gives a comboBox i want prev/next button like "Month" has got...... where n what tweaks have to be done ?

+1  A: 

That gives a syntax error. Also, true should be passed as a boolean literal, not a string. Looking for this?

$(function() {
    $("#").datepicker({changeYear: true});
});

EDIT

Does this do what you want?

$("#calendar").datepicker({
    numberOfMonths: [3, 4],
    stepMonths: 12
});​
Eric
`but this gives a comboBox i want prev/next button like "Month" has got...... where n what tweaks have to be done ?` - what do you not understand by this? ;)
Reigel
@Eric: m absolutely sorry for that syntax error.. but this function will shows a dropdown box for year selection but i want next/prev button for changing the year.
FosterZ
@FosterZ: Ok, updated
Eric
@Eric:that was nice dear, but i'm expecting 2 buttons for changing the year, for a timebeing im gonna use above code thanx man.
FosterZ
@FosterZ: You're gonna have to rewrite the datepicker code if you want it to work in any other way
Eric