Page 1 of 1
Category Parameter
Posted: Wed Aug 06, 2003 2:32 pm
by mmcfadden
I would like to remove the Category drop down list from the Search script and I would like to still pass the selected category to the results page. I have found that when I do a search on my web site home page and select a category drop down the search results page has this category automatically selected. However with the drop down removed if I just hit submit again I am now searching everything.
Our problem originates from the fact that when we add additional categories and we now have 15. We don't want users to be confused by having all of those options on the results page. We would like to display only the selected option or remove the drop down all together. Is there a way to do this?
Category Parameter
Posted: Wed Aug 06, 2003 2:47 pm
by mark
You've already removed the drop down. Now you need to replace it with a hidden input by the same name with the desired value filled in.
<input type=hidden name=cq value="$cq">
Category Parameter
Posted: Wed Aug 06, 2003 2:56 pm
by mmcfadden
Our site is a directory or Portal in which every page has different drop down options. So potentially every page going to the same script needs to have a different hidden variable(category) selected each time they go to the search script. Is what you suggested going to work in my case? I am guessing that setting that hidden variable would be done on my html pages and then passed to the script right?
Category Parameter
Posted: Wed Aug 06, 2003 3:16 pm
by mmcfadden
That works great thank you!
Category Parameter
Posted: Mon Aug 11, 2003 5:46 pm
by mmcfadden
I am wanting to display something different than the Drop down box but with the selected category displayed in text. For example on the Search results page I would like to display this in text
You are now searching in "category here" Is there a way to use the hidden input to dynamically display the category?
Category Parameter
Posted: Mon Aug 11, 2003 6:16 pm
by mark
Use <if> or <switch> to decide what to show the used based on the variable's value. Or use <sql> to lookup the category name in the categories table based on the category number variable.