User 4c0abb5ef9
28-08-2007 14:07:02
Is there an example somewhere in between the jsp simple_db_search and the db_search?
I would like to add a few extra search boxes to the simple search such as Name and Formula search. If I use the db_search example and tick the box "with all user defined fields" then all the fields in my database appear.
However, I don't want all the fields to be displayed and they all have the field option values of <, <=, =, >=, > .
Surely text fields such as name should contain options such as 'contains' , 'starts with' etc.
i.e. <option value="=">equals
<option value="contains">contains
<option value="pre">starts with
<option value="post">ends with
For a numeric field can you also add the search option between two number
i.e. <option value="between">between (xxx yyy)
This would be useful for such fields as bp or mp.
If I add (to the index.jsp file) something like:-
<tr><td align="right"><font face="helvetica" size="1">Formula </td>
<td align="right"><select name='formula'>
<option value='<'><</option>
<option value='<='><=</option>
<option value='=' selected>=</option>
<option value='>='>>=</option>
<option value='>'>></option>
</select></td>
<td><input type='text' name='value1' size='15'>
<input type='hidden' name='field1' value='CD_FORMULA'>
<input type='hidden' name='type1' value='12'>
</td> </tr>
How do I:-
i) Make them searchable
ii) Display the results in the search.jsp screen
I would like to add a few extra search boxes to the simple search such as Name and Formula search. If I use the db_search example and tick the box "with all user defined fields" then all the fields in my database appear.
However, I don't want all the fields to be displayed and they all have the field option values of <, <=, =, >=, > .
Surely text fields such as name should contain options such as 'contains' , 'starts with' etc.
i.e. <option value="=">equals
<option value="contains">contains
<option value="pre">starts with
<option value="post">ends with
For a numeric field can you also add the search option between two number
i.e. <option value="between">between (xxx yyy)
This would be useful for such fields as bp or mp.
If I add (to the index.jsp file) something like:-
<tr><td align="right"><font face="helvetica" size="1">Formula </td>
<td align="right"><select name='formula'>
<option value='<'><</option>
<option value='<='><=</option>
<option value='=' selected>=</option>
<option value='>='>>=</option>
<option value='>'>></option>
</select></td>
<td><input type='text' name='value1' size='15'>
<input type='hidden' name='field1' value='CD_FORMULA'>
<input type='hidden' name='type1' value='12'>
</td> </tr>
How do I:-
i) Make them searchable
ii) Display the results in the search.jsp screen