SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Nov 2008
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    javascript and php

    hi there

    I don't know much about JavaScript but i need to use the jQuery datepicker in my application.

    How can I modify jquery datepicker example, in order to get a new page loading as i was clicking a link...

    can I do that? how?

    ps: I know some php. At this moment I have to click a submit button to load a webpage with the selected date as a parameter. I put the selected date in a hidden input. How can I do that without pressing a button?

  2. #2
    SitePoint Zealot Amenthes's Avatar
    Join Date
    Oct 2006
    Location
    Bucharest, Romania
    Posts
    143
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You should use the onSelect event of the datepicker:

    http://docs.jquery.com/UI/Datepicker/datepicker#options

    Something like this, although I'm not that sure it will work:

    Code JavaScript:
    $(document).ready() {
        $(".selector").datepicker({
            onSelect: function(dateText) {
                this.value = dateText;
                $("#form-id").submit();
            }
        });
    }
    I'm under construction | http://igstan.ro/


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •