David Grenier David Grenier - 10 months ago 53
jQuery Question

Getting value from JQUERY datepicker

If I want to display the JQUERY UI datepicker inline by attaching it to a DIV like

- how do I access the chosen date? I assume if it's not bound to an
then it won't be submitted with the form.

I guess as a followup, if I need to bind it to an INPUT element, is there a way to control the positioning of the datepicker relative to the INPUT element? If I wanted the datepicker to appear above or to the side of the element rather than below it, how would I do that?

Forgive me if this answer is somewhere really obvious.

Answer Source

If you want to get the date when the user selects it, you can do this:

    onSelect: function()
        var dateObject = $(this).datepicker('getDate'); 

I am not sure about the second part of your question. But, have you tried using style sheets and relative positioning?