Question

My goal is to have a jQuery datepicker pop up when the user clicks a link, not a text box. Additionally, I was wondering if I can set up links from a given date (to list scheduled events).

I've been attempting to modify the demo code on the jQuery demo site and others to fit these requirements, but I'm very unfamiliar with javascript and jQuery so I've been having a lot of trouble.

Any help is much appreciated!

Was it helpful?

Solution

Well, the first part is easy:

<a href="javascript:$('#whatever').datepicker()">link text</a>

The second is a bit difficult, but you might be able to do something like:

<script type="text/javascript">
$('#whatever td:has(a:contains(19))').append('<a href="date_event?id=foo">Some Event</a>');
</script>

to add a link to the cell for the 19th, for example.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top