Search by drop down list and checkbox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • StarLavender
    New Member
    • Apr 2010
    • 33

    Search by drop down list and checkbox

    Hi. I want to create a search form using the drop down list and checkbox. First, the users have to select from drop down list whether they want to search by date or id. After that, for example, a new pair of drop down list will display for the users to choose the start date and end date. Second, the users have to check the checkbox to make sure what type of information that they want to filter. I have done the form for searching but I don't know How to do the searching script. All the data will be retrieved from MySQL database. Below is parts of the code. Thanks in advance for any help.

    Code:
    <td class="fontBold">Search By:</td>					
    <td><select name="search" id="search" class="font" onChange="display(this, 'date', 'id');">
    <option value="">-- Please select --</option>
    <option value="date">Date</option>
    <option value="id">ID</option>
    </select>
    </td>
    </tr>
    Code:
    <table width="1000" border="1" align="center">
    <tr>		  
    <td class="fontBold">Filter:</td>
    <td><input type="checkbox" name="check_filter" id="check_filter" value="yes" onClick="check(document.search.check_list)">Check All</td>
    </tr>
    <tr>
    <td><input type="checkbox" name="check_list" id="no" value="1">No</td>
    <td><input type="checkbox" name="check_list" id="id" value="2">ID</td>
    <td><input type="checkbox" name="check_list" id="type" value="3">Type</td>
    <td><input type="checkbox" name="check_list" id="address" value="4">Address</td>
    </tr>
    <tr>
    <td><input type="checkbox" name="check_list" id="status" value="5">Status</td>
    <td><input type="checkbox" name="check_list" id="start_date" value="6">Start Date</td>
    <td><input type="checkbox" name="check_list" id="end_date" value="7">End Date</td>
    <td><input type="checkbox" name="check_list" id="amount" value="8">amount</td>
    </tr>
    //...
    //...
    //...others type of filter
    </table>
Working...