Results 1 to 2 of 2

Thread: Help passing value from Jasons Calendar Script

  1. #1
    Join Date
    Dec 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Help passing value from Jasons Calendar Script

    1) Script Title:
    Jasons Date Input Calendar

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

    3) Describe problem:
    I am trying to pass the value from the calendar to a PHP variable using the $_POST, so that I can insert it into a MySQL database, however, it always submits the default value (today). Even after you select the date from the calendar, it still posts the default date. Here are the bits of code I used:

    in Header section:
    Code:
    <!-- java script for calendar-->
    <script type="text/javascript" src="calendarDateInput.js">
    
    /***********************************************
    * Jason's Date Input Calendar- By Jason Moon http://calendar.moonscript.com/dateinput.cfm
    * Script featured on and available at http://www.dynamicdrive.com
    * Keep this notice intact for use.
    ***********************************************/
    
    </script>
    to call the script:
    Code:
    <td><script>DateInput('startdate', true, 'YYYY-MM-DD')</script></td>
    <input type="button" id="startdate" onclick="alert(this.form.startdate.value)" value="Show date value passed">
    to retrieve value after submitting form:
    Code:
    $startdate = (isset($_POST['startdate'])) ? ($_POST['startdate']) : '';
    Can anyone help?

    Thanks
    Amit

    MODS please close
    Last edited by amavadia; 12-03-2009 at 03:32 PM. Reason: Resolved

  2. #2
    Join Date
    Dec 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Just worked it out...
    The script creates its own hidden form with the value, I didnt need to create my own!


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
  •