PHP Date Picker

Discussion in 'PHP' started by obenix, Dec 31, 2005.

  1. #1
    I have a date field which is intended for the user to enter. From my experience, users typically make errors in the format (dd/mm/yyyy & mm/dd/yyyy). Therefore, instead of having users to key in the dates, I intend to have a date picker, much a the calendar function.

    I intend to have the date field grey and disabled for data entry, a little icon beside the field where upon clicking, a popup calendar appears adn user simply click on the desired date.

    Can anyone point me in the right direction? Appreciate your assistance. :)
     
    obenix, Dec 31, 2005 IP
  2. n0other

    n0other Peon

    Messages:
    146
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    This is javascript thing. www DOT corion DOT net/js/datepicker/index.html (post count thingy)
     
    n0other, Dec 31, 2005 IP
  3. onlyican.com

    onlyican.com Peon

    Messages:
    206
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Another way round it is to have selection boxes

    <form method = "POST" action="page.php">
    <select name="date_d"><option>01</option>02......</select>
    <select name"date_m"><option value="01">January</option><option value="02">Febuary............</select>
    <select name="date_y"><option>2005</<option><option>2006..........</select>
    </form>
    then

    $date_d = $_POST["date_d"];
    $date_m = $_POST["date_m"];
    $date_y = $_POST["date_y"];
    $date = ($date_y-$date_m-$date_d);

    echo $date;
    ////Just to check it is done correctly

    This becomes a pain for DOB, as where do you start 1900 to 2000, thats 100 options to choose from
     
    onlyican.com, Jan 1, 2006 IP