Results 1 to 2 of 2
  1. #1

    Validation of php drop down menu of months,days and years

    Cannot get it to validate, for leaps years, and feb,april 31.
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

    if(isset($todo) and $todo=="submit"){
    echo "mm/dd/yyyy format :$date_value<br>";
    echo "YYYY-mm-dd format :$date_value<br>";


    echo "invalid date";
    }else {
    echo "Entry date is correct";

    <form method=post name=f1 action=''><input type=hidden name=todo value=submit>
    <table border="0" cellspacing="0" >
    <tr><td align=left >
    <select name=month value=''>Select Month
    <option value='01'>January</option>
    <option value='02'>February</option>
    <option value='03'>March</option>
    <option value='04'>April</option>
    <option value='05'>May</option>
    <option value='06'>June</option>
    <option value='07'>July</option>
    <option value='08'>August</option>
    <option value='09'>September</option>
    <option value='10'>October</option>
    <option value='11'>November</option>
    <option value='12'>December</option>

    </td><td align=left >
    Date<select name=dt >
    <option value='01'>01</option>

    <option value='02'>02</option>
    <option value='03'>03</option>
    <option value='04'>04</option>
    <option value='05'>05</option>
    <option value='06'>06</option>
    <option value='07'>07</option>
    <option value='08'>08</option>
    <option value='09'>09</option>
    <option value='10'>10</option>
    <option value='11'>11</option>
    <option value='12'>12</option>
    <option value='13'>13</option>
    <option value='14'>14</option>
    <option value='15'>15</option>
    <option value='16'>16</option>
    <option value='17'>17</option>
    <option value='18'>18</option>
    <option value='19'>19</option>
    <option value='20'>20</option>
    <option value='21'>21</option>
    <option value='22'>22</option>
    <option value='23'>23</option>
    <option value='24'>24</option>
    <option value='25'>25</option>
    <option value='26'>26</option>
    <option value='27'>27</option>
    <option value='28'>28</option>
    <option value='29'>29</option>
    <option value='30'>30</option>
    <option value='31'>31</option>

    <tr><td align=left >
    <select name=year value=''>Select Year
    <option value='2009'>2009</option>
    <option value='2010'>2010</option>
    <option value='2011'>2011</option>
    <option value='2012'>2012</option>
    <option value='2013'>2013</option>
    <option value='2014'>2014</option>
    <option value='2015'>2015</option>
    <option value='2016'>2016</option>
    <option value='2017'>2017</option>
    <option value='2018'>2018</option>
    <option value='2019'>2019</option>
    <option value='2020'>2020</option>

    <input type=submit value=Submit>



  2. #2
    Join Date
    Jun 2009


    Are you trying to get specifically for the date April 31?
    I think you need to calculate only till April 30th...

    Please use like this:

    PHP Code:


    "invalid date";
    }else {
    "Entry date is correct";
    Neseema M M
    Ezeelogin - The ultimate multiple server administration software.
    * Parallel shell * rm -rf protection * SSH logging * automated password changes * encrypted storage * - Delivering innovative web hosting solutions

Similar Threads

  1. Drop down menu BUG in IE..
    By snowboarderz69 in forum Web Design and Content
    Replies: 1
    Last Post: 07-17-2009, 01:44 PM
  2. drop down menu for cms
    By 5wayshost in forum Web Design and Content
    Replies: 1
    Last Post: 11-21-2007, 02:28 PM
  3. Need help with a CSS Drop down menu
    By ChrisF79 in forum Web Design and Content
    Replies: 3
    Last Post: 10-25-2006, 08:02 PM
  4. CSS Drop Down Menu Help
    By mxway in forum Web Design and Content
    Replies: 6
    Last Post: 12-20-2005, 05:30 PM
  5. PHP & Drop Down Menu
    By aingaran in forum Programming Discussion
    Replies: 4
    Last Post: 01-03-2004, 07:15 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts