Results 1 to 4 of 4

Thread: date picker

  1. #1
    Join Date
    Oct 2004
    Posts
    425
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default date picker

    I want a "date picker" for my site at http://paphoscarhire.com/index-cal.php like http://www.nzrentalcar.co.nz/ ... you have such ? Also in the webpage http://paphoscarhire.com/index-cal.php I use php for dates[not js] is needed convert to work ?

    Code:
            <tr>
              <td width="50%" height="1" align="center" bgcolor="#686F2C">
              <p style="margin-top: 0; margin-bottom: 0"><b>
                <font face="Arial" size="2">Pickup Date</font></b></td>
              <td width="50%" height="1">
              <p align="left" style="margin-top: 0; margin-bottom: 0">
              <font face="Arial">
              <select name="pickUpMonth" style="font-size: 8pt" tabindex="1">
              <?php
              $curdate = getdate();
    	      $curday = $curdate['mday'];
    	      $curmonth = $curdate['mon'];
              $curyear = $curdate['year'];
    	      $arr_months = array(1 => 
              "January", 2 => "February", 3 => "March", 4 => "April", 5 => "May", 6 => "June", 7 => "July", 8 => "August", 9 => "September", 10 => "October", 11 => "November", 12 => "December");
              
    
              foreach ($arr_months as $i => $monthname) 
              { 
               if ($i == $curmonth) 
                echo "<option value='$i' selected>$monthname</option>"; 
               else 
                echo "<option value='$i'>$monthname</option>";
              }
              ?>
              </select> 
              <select name="pickUpDay" tabindex="5" style="font-size: 8pt">
              <?php
    	   		$curdate = getdate();
    	        $curday = $curdate['mday'];
    	        $curmonth = $curdate['mon'];
    	        $curyear = $curdate['year'];
    	        for ($i = 1; $i <= 31; $i++) 
                   { 
                      if ($i == $curday) 
                         echo '<option value="', $i, '" selected>', $i, '</option>'; 
                      else 
                         echo '<option value="', $i, '">', $i, '</option>';
                   } 
              ?>
              </select> 
              <select name="pickUpYear" style="font-size: 8pt" tabindex="15">
              <?php
    	  		 $curdate = getdate();
    	   		 $curday = $curdate['mday'];
    	   		 $curmonth = $curdate['mon'];
    	   	     $curyear = $curdate['year'];
                 for ($i = 2007; $i <= 2010; $i++) 
                   { 
                      if ($i == $curyear) 
                         echo '<option value="', $i, '" selected>', $i, '</option>'; 
                      else 
                         echo '<option value="', $i, '">', $i, '</option>';
                   } 
              ?>
              </select></font></td>
            </tr>

  2. #2
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Have you seen this or this?

  3. #3
    Join Date
    Oct 2004
    Posts
    425
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default

    Jason's Date Input Calendar
    http://www.dynamicdrive.com/dynamici...oncalendar.htm
    MAY CONVERT THE TEXTBOX TO DROPDOWN MENU ? If I do this(but have in drop down dates 2008-2013) and choose from calendar a date 2014 , what will happen ?

    I use php for dates[not js] is needed convert to work the "Jason's Date Input Calendar
    " ?

  4. #4
    Join Date
    Oct 2004
    Posts
    425
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default

    Jason's Date Input Calendar
    http://www.dynamicdrive.com/dynamici...oncalendar.htm
    Is needed build the date fields of html form myself(2 drop down and 1 textbox fields) or are built automatically by the script (js) ?
    answer and above

Bookmarks

Posting Permissions

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