I am trying to get a date picker working and I am really struggling with my limited javascript knowledge. I have been basing this on this tutorial.
I have the following code:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="scripts/date.js"></script>
<script type="text/javascript" src="scripts/jquery.datePicker.js"></script>
<script type="text/javascript" charset="utf-8">
$(function()
{
$('.date-pick').datePicker().val(new Date().asString()).trigger('change');
});
</script>
…
<input name="oDate" id="oDate" class="date-pick" />
Any suggestions would be very much appreciated.
i would suggest you take a look at the regular jquery ui datepicker to get a standard out of the box datepicker working. Start by simply using the exact code you see here and then tweak (step by step) as necessary. There are tons of example for all different use cases and good documentation