#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2004
    Posts
    52
    Rep Power
    11

    Datepicker problem


    Hi,

    I am using jQuery datepicker like this:

    in <head>:
    PHP Code:
    <script type="text/javascript">
        $(function ()
        {
            $(
    "#dateBirthday").datepicker({ dateFormat"dd-mm-yy",
            
    changeYeartrue,
            
    showOn"button",
            
    buttonImage"http://localhost/xoompage/images/calendar.gif",
            
    buttonImageOnlyfalse })
        });
    </script> 
    PHP Code:
    <form name="form1" method="post" action="update_member_personal_information.php">
    <input type="text" id="dateBirthday" name="dateBirthday" value="<?php echo $member_date_of_birth?>" autocomplete="off" disabled required>
    <button id="btnSave" type="submit">Save</button>
    <button id="btnCancel" type="button">Cancel</button>
    and:

    PHP Code:
    <script type="text/javascript">
    $(function() { $( 
    "#btnSave" ).button(); });
    $(function() { $( 
    "#btnCancel" ).button(); });
     
    $(
    '#btnCancel').click(function() { window.location 'memberhome.php' });
    </script> 
    in update_member_personal_information.php:

    PHP Code:
    $member_birthday $_POST['dateBirthday'];
    $date_of_birth date('Y-m-d'strtotime($member_birthday));
     
    $mysql_query->bindParam(':param_date_of_birth'$date_of_birthPDO::PARAM_STR); 
    but I am getting the following error:

    Notice: Undefined index: dateBirthday in C:\xampp\htdocs\xoompage\update_member_personal_information.php on line 9


    what's wrong? and how can I fix it please?
    Regards,
    Jassim
    RMC - UME
    Xoom Page
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2003
    Posts
    3,571
    Rep Power
    595
    Is that code being executed before the submit button is clicked? Unless you did not post all your code, I do not see where you check if the form was submitted or it is the first time the page is displayed. You probably need to use 'isset' one way or another to determine that the $_POST data is filled in.
    There are 10 kinds of people in the world. Those that understand binary and those that don't.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2004
    Posts
    52
    Rep Power
    11
    both files attached..
    Attached Files
    Regards,
    Jassim
    RMC - UME
    Xoom Page
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2009
    Posts
    695
    Rep Power
    7
    Tip: Disabled <input> elements in a form will not be submitted.

    Code:
    <input type="text" id="dateBirthday" name="dateBirthday" value="<?php echo $member_date_of_birth; ?>" autocomplete="off" disabled required>

    Comments on this post

    • jrahma agrees
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2004
    Posts
    52
    Rep Power
    11
    Thanks

    I was confused between disabled and readonly

    it's working now..
    Regards,
    Jassim
    RMC - UME
    Xoom Page

IMN logo majestic logo threadwatch logo seochat tools logo