Results 1 to 7 of 7

Thread: Simple change to output of Jason's calendar

  1. #1
    Join Date
    Jun 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Simple change to output of Jason's calendar

    Hi - Jason's script looks great. Can someone please help me to convert the output to have values of "day", "month" and "year" in a select form (example below) I'm modifying a CMS I found and I know a little php but ZERO Javascript so if you do help please don't use too much JS jargon

    thanks in advance
    Duncan


    -------------------Example output below---------------------------------

    <script>DateInput('orderdate', true, 'DD-MON-YYYY')</script>

    convert to following format;

    <select name="day"><option selected value="13">Day</option></select>
    <select name="month"><option selected value="2">Month</option</select>
    <select name="year"><option selected value="1975">Year</option></select>
    Last edited by duncano74; 06-02-2006 at 03:12 AM.

  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

    Warning: Please include a link to the DD script in question in your post. See this thread for the proper posting format when asking a question.


    Please post a link to the page on your site that contains the problematic script so we can check it out.


    I think this was already answered, try searching the archives. Yes, look here:

    http://www.dynamicdrive.com/forums/s...ead.php?t=6379
    Last edited by jscheuer1; 06-02-2006 at 04:42 AM.
    - John
    ________________________

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

  3. #3
    Join Date
    Jun 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Ok - thanks for that. Here's the link to the script - I don't believe a link to my site will help in this case;

    Jason's Date Input Calendar

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

    I read that post before actually. To be honest, I can't understand it or Jason's script - I'm slowly learning PHP and I can generally understand even some complex PHP scripts, but I'm struggling with JS even after I spent a couple of hours going through this script.

    Can you point me to the specific portion in the JS which specifies the "writeln" output for;

    <select name="dateinput">'DD-MON-YYYY'</select>

    and possibly a clue as to how I can change it to have the following output;

    <select name="day">DD</select>
    <select name="month">MON</select>
    <select name="year">YYYY</select>

    Apologies for my lack of knowledge - and many thanks for any help.

    Duncan
    Last edited by duncano74; 06-02-2006 at 08:21 AM.

  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

    It isn't one specific spot. The writeln code actually writes other code that accomplishes these things when the user interacts with it. If you follow the instructions from that post, a simple 'replace from here to the end of the script with this' - it will work just like the original except in the format DD-MM-YYYY, which is what you want, right?
    - John
    ________________________

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

  5. #5
    Join Date
    Jun 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Ok - I think see where I've gone wrong in my earlier question.

    Actually - I'm struggling with how the Javascript interacts during the POST function. NOT the day/month ordering for presentation (incidently I did want DD/MM/YYYY in the final rendering but I managed to get that relatively easily.

    My problem is that I am quite new to programing and I don't have a complete grasp of how the POST works and so I'm stuggling with finding the critical parts in Jason's script to change the POST sent from the JS script that will be received by the next CMS page.

    If I'm understanding it correctly- I believe the javascript creates the presentation of the calendar and then, on the submit action, it posts the date selected to the page that recieves the post(?) .

    All I know is that the original CALENDAR FORM in the CMS formats its date in 3 separate <select> statements. One each for the Day, Month and Year (I don't believe presentation ordering is relavant here). I'm not completely sure what the post data from Jasons script looks like or how to change it to get it to interact with the CMS scripts correctly. Essentially I want to know how to check the POST format from the script and to then change it if needed.

    I've written a lot and if you made it this far then well done!!!!

  6. #6
    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

    The way it posts is controlled here in the script call on your presentational page (from the demo page's step2, highlight red):

    Code:
    <script>DateInput('orderdate', true, 'DD-MON-YYYY')</script>
    You can configure to post in many ways (also from the demo page, under additional information):

    YYYYMMDD
    YYYY-MM-DD *
    YYYY-DD-MM *
    YYYY/MM/DD *
    YYYY/DD/MM *
    YYYY-DD-MON * **
    YYYY-MON-DD * **
    MM-DD-YYYY *
    DD-MM-YYYY *
    MM/DD/YYYY *
    DD/MM/YYYY *
    DD-MON-YYYY * **
    MON-DD-YYYY * **
    * 2-digit year can be used instead of 4-digit year
    ** 3-character month name abbreviation can also be specified as MMM.
    - John
    ________________________

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

  7. #7
    Join Date
    Jun 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks John - I spent this morning learning about datestamps and it seems that the way the CMS required it to be broken down into the 3 separate selects was circumventable and the date stamp could be used straight out of Jason's script without modification.

    thanks for your patience,

    Duncan

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
  •