drtanz Posted May 7, 2008 Share Posted May 7, 2008 hi i would like to include a field in my form showing a date selection dropdown dd-mm-yyyy and by default this would show the current date. How can i do this? thanks Link to comment https://forums.phpfreaks.com/topic/104527-date-selection-with-current-date/ Share on other sites More sharing options...
ablueycolor Posted May 7, 2008 Share Posted May 7, 2008 Here is the basics to the three select boxes. I have to get ready for work but I'm sure someone would happily fill in the blanks for selecting the current date. <select name="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> </select> Day <select name="day" > <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> </select> <?php $curryear = date('Y'); ?> Year: <select name="year" > <?php for ($i = $curryear - 50; $i < $curryear; $i++) { ?> <option value="<?php echo $i; ?>"><?php echo $i; ?></option> <?php } ?> Link to comment https://forums.phpfreaks.com/topic/104527-date-selection-with-current-date/#findComment-535091 Share on other sites More sharing options...
sushant_d84 Posted May 7, 2008 Share Posted May 7, 2008 Hi You can also go for JavaScript HTML css based Calender system See the attached Image !!!!!!!! Regards Sushant Danekar [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/104527-date-selection-with-current-date/#findComment-535104 Share on other sites More sharing options...
saint959 Posted May 7, 2008 Share Posted May 7, 2008 Hey check this post: http://www.phpfreaks.com/forums/index.php/topic,195848.0.html it was one started yesterday and i think its what you looking for Link to comment https://forums.phpfreaks.com/topic/104527-date-selection-with-current-date/#findComment-535117 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.