Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search Form Code Help Needed

Status
Not open for further replies.

technobia

ISP
Sep 8, 2005
53
US
The following is related to a Xoops website. I have posted on that forum with out any replies on over a week. I am not a programmer but I am fully capable of modifying code.

RE: Xoops 2.0.16 running xcGallery 2.03 module

I would like to add pre-selected search terms in a drop down list that user can use to search via selection OR manually enter other keyword criteria in an exiting field that already exists in the code that works.

Because this is an art gallery site. Some of the pre-selectable search terms needed in the drop down list should be things like: Abstract, Landscapes, Photography etc.

I have successfully added the drop down list (see code below) but I do not know how to do the coding to get it to query the DB and display the results just as the normal manual entry keyword search works when clicking the submit search button.

I would like to have the user select something from the list and then click the search button OR once they let go of the selection from the list the search begins automatically. Either one would be fine.

============================================================
<div align="center">
<table border="1" width="400" bordercolor="#1D829C" id="table2" cellpadding="10">
<tr>
<td>

<p align="center">Please enter a search criteria to fulfill your project needs.<br />
You may search by color, style, genre, artist, media, etc.</p>

<form bordercolor="#1D829C" style="margin 0; padding: 0;" method="get" action="thumbnails.php" >
<div bordercolor="#1D829C" align="center">
<table width="400" cellspacing="1" cellpadding="0" style="width: 100%;">
<tr>
<td align="center" class="foot">

BEGIN NON-WORKING CODE

<select size="1" name="search" class="textinput">
<option value="Abstract">Abstract</option>
<option value="Landscape">Landscape</option>
<option value="Photography">Photography</option>
</select>&nbsp;

END NON-WORKING CODE

<input type="input" style="width: 216; height: 22" name="search" maxlength="255" value="" class="textinput" />&nbsp;&nbsp;
<input type="submit" value="Submit Search" class="button" />
</td>
</tr>
</table>
</div>
<input type="hidden" name="type" value="full" />
<input type="hidden" name="album" value="search" />
</form>

</td>
</tr>
</table>
</div>
============================================================
This seems like it should be pretty simple but it is making me pull my hair out as I am on deadline with this project.

Thanks so much! Any assistance will be GREATLY appreciated.
 
Unfortunately this is not an HTML issue. As you have seen it deals with coding the action of the form. Since you haven't told us what language its coded in, (ASP, PHP, Coldfusion, etc..) there really isn't much we can help you with.

Other than to say, you need to take the value form the select box, and stick it into the query you are generating.





----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Thanks for the reply vacunita.

Xoops is written in PHP. I have looked at the language file and the search.php for this particular module but I do not understand it enough to figure out what is required. I Just not sure how to do that. What would you suggest?


 
I agree with Chris, if its developed in PHP, then forum434 is the place to post this. You might also want to post the relevant code that parses the form, so we can tell you what to add where. It should not be to difficult, but we need to see it.

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top