PDA

View Full Version : Jquery Date Picker



rhodarose
05-09-2011, 06:20 AM
Good day!

I explore something so I used jquery in my date, without any knowledge about jquery. I research a sample Jquery Date Picker internet and I found one, my problem is the Year is started at 2001 , I don't know if I could change it so that the year would start atleast 1950's or 1990's

here's the code that I add in my webpage to display the Jquery Date Picker


<link rel="stylesheet" href="ui.all.css" type="text/css" media="screen" />

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script>

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.5.3/jquery-ui.min.js"></script>

<script type="text/javascript">

$(document).ready(function(){

$("#date").datepicker({ showOn: 'button', buttonText: "Select your Birthday" });

});

</script>




I will attach the date picker that I get from internet.

Thank you

midhul
05-09-2011, 07:34 AM
Just use the yearRange property {1950:2014}, or something like that:




<script type="text/javascript">

$(document).ready(function(){

$("#date").datepicker({ showOn: 'button', buttonText: "Select your Birthday", yearRange: '1950:2014' });

});

</script>



Jquery UI has a detailed documentation, so you better check this: http://docs.jquery.com/UI/Datepicker#option-yearRange

rhodarose
05-09-2011, 07:53 AM
Thank you..it works