× If you expect answers you should describe your problem and give as much information's as possible. (SQL-Structure, Template Code, Joomla Version ...) Please read this before posting: joodb.feenders.de/support.html

Searchbox only in selected field

  • william.kcperformance
  • william.kcperformance's Avatar
  • Offline
More
10 years 11 months ago - 10 years 11 months ago #1853 by william.kcperformance
Searchbox only in selected field was created by william.kcperformance
Is it possible to hide the "All fields" option in the search box, this causes to show unwanted results.
I've created a specific field in which I want the user to search, in this field there's for instance: [ ALFA ROMEO 147 1.9 JTD Diesel 2003 ]
Someone who is looking for a certain car can use this as quick search, let's say he enters 147 1.9 jtd 03...
Last edit: 10 years 11 months ago by william.kcperformance. Reason: typo

Please Log in to join the conversation.

  • william.kcperformance
  • william.kcperformance's Avatar
  • Offline
More
10 years 10 months ago #1918 by william.kcperformance
Replied by william.kcperformance on topic Re: Searchbox only in selected field
Hi guys, I could really use some "guidance" here ;-)

Thanks a lot! :-)

Please Log in to join the conversation.

More
10 years 10 months ago #1925 by Dirk
Replied by Dirk on topic Re: Searchbox only in selected field

william.kcperformance wrote: Is it possible to hide the "All fields" option in the search box, this causes to show unwanted results.


Only is you use the same field two times in the form. The "All fields" option is meant to reset the result for multiple selects. If you don't want to change the joodb core directly you can use javascript to remove the first item from the select boxes.

Insert the following code into your template:
<script type="text/javascript" >
$$('select.groupselect').each(function(el){el.remove(0)});
</script>

Please Log in to join the conversation.

  • william.kcperformance
  • william.kcperformance's Avatar
  • Offline
More
10 years 10 months ago - 10 years 10 months ago #1927 by william.kcperformance
Replied by william.kcperformance on topic Re: Searchbox only in selected field
Hi Dirk, thanks a lot for your reply! :-)

I'm sorry, I didn't ask/explain clear enough.
What I mean is that I've created a column that contains the data that can be used to find a specific car.
So a visitor can search with the term " 145 1.4 ts" for instance.
The problem is that when all fields are being used, also the cars with 145 bhp show up.
Thus, because I've set it up like this, the "All fields" pull down is redundant, "reset" also but that's another story.
Also, since I use only one field, the pull down has no use I guess?

Can you assist me with this, thanks a lot anyway!
Last edit: 10 years 10 months ago by william.kcperformance.

Please Log in to join the conversation.

Moderators: Dirkjoest