Results 1 to 3 of 3

Thread: Capturing and Passing Jason's Calendar Date

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

    Default Capturing and Passing Jason's Calendar Date

    1) Script Title: Jason's Date Input Calendar

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

    3) Describe problem: Can't capture date

    Hello,

    First, there is no problem with the calendar code, it is because I am a twit and new to forms, HTML, js ... the list goes on. The problem is that I simply don't have the foggiest how to pass the date, entered using Jason's Calendar, from my form and (eventually) into an email. The DD example given (below) illustrates the date being shown when a button is clicked.

    <form>

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

    <input type="button" onClick="alert(this.form.orderdate.value)" value="Show date value passed">

    </form>

    However, I wish the date to be one of many variables taken and sent to an email on clicking a "submit" button. I *think* the answer must be easy, but I have tried in vain to get it to work. I assume the lines of code I need are something like:

    <script>DateInput('orderDate', true, 'DD-MON-YYYY')</script> <input name="Date" type="hidden" onChange="alert(this.form.orderDate.value)" />

    Although this does fails to send the date.

    Any help appreciated. Forgive me if this is ridiculously easy

  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

    First off, this:

    Code:
    <input type="button" onClick="alert(this.form.orderdate.value)" value="Show date value passed">
    Is just for testing/diagnostic purposes. The script itself creates a hidden input field with the date data. The name of that field is configurable and shown in red in the below call:

    Code:
    <script>DateInput('orderdate', true, 'DD-MON-YYYY')</script>
    So, if the script is placed within your form and your form grabs the value of all of its fields, you are in business. Otherwise, you need to add something to your form processing routine so that it will grab the value contained in the orderdate field and do with it whatever it is that you want done with it.
    - John
    ________________________

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

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

    Default

    Clunk!

    Many thanks indeed John. On reading through the details on the example page it becomes immediately obvious what to do... only now that you have explained it to me!

    Thanks again

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
  •