views:

233

answers:

1

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!

+1  A: 

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.

chaos
Thanks so much for your help! One more thing: If i wanted to set a link for any date selected (i.e. if i select the 19th it will open up another web page. Essentially, each date would be a link to the same page.
synchronicity
I figured it out, thanks!
synchronicity