Search By Date

3 posts by 2 authors in: Forums > CMS Builder
Last Post: October 26, 2009   (RSS)

By Kenny - October 24, 2009

I have a date searching issue.

I have the form set up, but it it is escaping me right now how to get it to work correctly.

The problem is that I have a Month, Year, and Day drop-down set up but I need them to talk to each other. Right now if you search for January 9, 2009 (a day with NO entries) it will bring up all the entries for September 9th and October 9th.

Here's my code:

<form action="maintenance.php" method="get">
<div align="center">
<table id="table4" border="0" cellpadding="3" cellspacing="3">
<tbody>
<tr>
<td bgcolor="#FFFFFF">

<table id="table5" border="0" cellpadding="3" cellspacing="3">
<tbody>
<tr>
<td style="font-size: 10pt">Search By Date</td>
<td>
<select name="createdDate_year">
<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>
<select name="createdDate_day">
<option selected value="01" >1</option>
<option value="02" >2</option>
<option value="03" >3</option>
<option value="04" >4</option>
<option value="05" >5</option>
<option value="06" >6</option>
<option value="07" >7</option>
<option value="08" >8</option>
<option value="09" >9</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>
<select name="createdDate_year">
<option value="2009" selected="selected" >2009</option>

</select> </td>
</tr>
</tbody>
</table>

<p>
</p>
<div align="center">
<input name="search" type="submit" value=" Search By Date " />
</div>

</td>
</tr>
</tbody>
</table>
</div>
</form>

Re: [Dave] Search By Date

By Kenny - October 26, 2009

Well that was easy - I shouldn't be coding so late at night! But when else would we do it?

I like the date range search - I'll give that a try. Thanks Dave!