Jump to content

Drop Down Menu Validation


sean04

Recommended Posts

Hi everyone!

 

I have 3 drop down menus: $month, $day, $year which are placed in my database when the update button is clicked.

 

How can I get all 3 drop down menus ($month, $day, $year) to work with each other and validate if its a correct date (eg. Can't Enter April 31,1990 because April only goes up to 30).

 

Also for these drop down menus, I would like an easy way for the years 2005 to 1930 to appear with out manually doing it :P maybe even the months.

 

Any help is great! thanks!

Link to comment
https://forums.phpfreaks.com/topic/169862-drop-down-menu-validation/
Share on other sites

PHP does not update after the page is loaded, javascript can do that

 

as far as the drop down menu for lots of options... try something like this

 

      echo "<select name='byear'>";
        $x=2005;
        while($x>=75)
        {
          echo "<option value='$x' />$x";
          $x--;
        }
      echo "</select>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.