SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Guru tictike's Avatar
    Join Date
    Apr 2008
    Location
    Canada
    Posts
    863
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    how to make a calendar pop up

    I asked this questions a while ago on this thread but it was recommend I start a new thread.

    I have this form and if the calendar icon in the date of birth field is clicked I want this calendar to pop up (and eventually a date picked from the calendar with fill in the date of birth field).

    I honestly don't understand the advice from the previous thread. One technique I can think of is to put the calendar html in the source code and give it display: none; and toggle it on when the icon is clicked (and somehow get the calendar to auto complete the date of birth field). But something tells me there is a much better way.

  2. #2
    Guru in training bronze trophy SoulScratch's Avatar
    Join Date
    Apr 2006
    Location
    Maryland
    Posts
    1,838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Define better way - less bytes? less http requests?
    Cross browser css bugs

    Dan Schulz you will be missed

  3. #3
    SitePoint Guru tictike's Avatar
    Join Date
    Apr 2008
    Location
    Canada
    Posts
    863
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    A better technique than the one I mentioned. One that doesn't put the calendar in the html. Originally I thought I didn't want it in the source because if js was disabled the calendar would be useless.

    Also, in the last couple posts of the older thread Paul was suggestions ways to accomplish this but I didn't understand.

  4. #4
    SitePoint Guru tictike's Avatar
    Join Date
    Apr 2008
    Location
    Canada
    Posts
    863
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Any other ideas? Or, Paul, can you please explain again what you did in the other thread because I did not understand.

    The more I think about this it shouldn't be in the html because it can only be used with js.

  5. #5
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,729
    Mentioned
    104 Post(s)
    Tagged
    4 Thread(s)
    The idea from that other thread is for the calendar script to search the page for a specific class name. When that class name is found, an image link is added to the page which will can then trigger the calendar to be created there.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  6. #6
    SitePoint Guru tictike's Avatar
    Join Date
    Apr 2008
    Location
    Canada
    Posts
    863
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh ok. I think in this case I will leave the image in the form from the start. The image is not a link right now, but it will be. When it is clicked what is the best way to create the calendar?

    Since I would rather not put it in the html source and do a simple toggle of its display property, is the next best way to create all the necessary elements with js, populate all the tds and position that newly created calendar?

    (I think I'm asking this the right way, not sure.)

  7. #7
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,729
    Mentioned
    104 Post(s)
    Tagged
    4 Thread(s)
    From what I see here I believe that you have a good grip on what's required.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  8. #8
    SitePoint Guru tictike's Avatar
    Join Date
    Apr 2008
    Location
    Canada
    Posts
    863
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    cool. Once I get the calendar to pop up I'll probably be back to ask other related questions. After considering post 5 I like your suggestion to only display a calendar image if js detects a specific class, because it's only useful with js on.


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
  •