Results 1 to 4 of 4

Thread: Sev's Popup Calendar - Help Echoing Variable

  1. #1
    Join Date
    Jan 2010
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Sev's Popup Calendar - Help Echoing Variable

    1) Script Title:
    Sev's Popup Calendar

    2) Script URL (on DD):
    http://www.dynamicdrive.com/dynamici...opcalendar.htm

    3) Describe problem:
    Easy question hopefully, I'm just not as familiar as I should be...

    I have an HTML form set up with Sev's Popup Calendar. The drop down works great, and the user's input is successfully placed into a field called "Date" as mm/dd/yyyy. No problems there.

    What I'd like to do is figure out how to have the appropriate day of the week then echo to a readonly form field called "Day". I've got the form field set up using [ input type="text" name="Day" readonly="readonly" ] but have no idea how to get the day of the week to show up there.

    Sev's script does have options where it will output the whole date with the day of the week, but I can only figure out how to get it into the "Date" field linked to the calendar, as one big variable.

    Any help would be appreciated.

    J

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    That calendar (though rated for IE and Opera) appears to only work in IE. Before we go into detail on your question, I'd want to be sure that it's OK with you that the calendar only works in that one browser. Is it?

    This one looks like (for cross browser compatibility) a better choice:

    http://www.dynamicdrive.com/dynamici...oncalendar.htm

    However, all of the calendar scripts on DD are old. You might do better with a more recent one from somewhere else.
    Last edited by jscheuer1; 01-09-2010 at 05:40 PM. Reason: add info about other scripts
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Jan 2010
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Gotcha... I'm looking for at least IE and FF compatible, but as many as possible would be great. I'll check out the link you sent and see what options it gives.

    Is there a general way to take a date produced from a calendar like that and have it generate the appropriate day of the week, then transfer it to the other field?

    Thanks!

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    In a way yes. You can find the spot in the script where it creates a Date object that holds the date chosen, or a place where you can create a Date object from the text representation of the date chosen, then one may use the getDay() method to extract a number 0 through 6 from that Date object, 0 being Sunday and 6 being Saturday. On the basis of that value you may populate your readonly field. Fairly simple really. But the best spot to do it would naturally depend upon which script one was using. Some calendar scripts (none of those on DD as far as I know) may even already provide for such a value and/or its text equivalent to be retrieved via a special callback or other syntax.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. The Following User Says Thank You to jscheuer1 For This Useful Post:

    dimatisah (01-09-2010)

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
  •