Page 1 of 1

Search box

Posted: Sun Aug 26, 2012 12:41 pm
by nico
A search box was added on the site, you can search for maps and for players.
There is no submit button, you just need to click on the result and a new page gets loaded.

Re: Search box

Posted: Sun Aug 26, 2012 2:29 pm
by stealth
Can you make it possible to press enter to go to the new page?
Also the suggestions disappear after a few seconds, could you make this delay longer?
And finally if you press enter with nothing selected, could you be brought to a normal search page, that uses the normal form submission? (Not needed, but some browsers don't support ajax)

Re: Search box

Posted: Sat Sep 15, 2012 6:00 pm
by nico
stealth wrote:Can you make it possible to press enter to go to the new page?
It seems it's not possible with the script I used (http://www.brandspankingnew.net/archive ... plete.html)
stealth wrote:Also the suggestions disappear after a few seconds, could you make this delay longer?
Increased to 5sec, enough?

stealth wrote:And finally if you press enter with nothing selected, could you be brought to a normal search page, that uses the normal form submission? (Not needed, but some browsers don't support ajax)
Cba hack the js script to do that :p

Re: Search box

Posted: Wed Oct 24, 2012 8:03 pm
by stealth
So I was looking at this again cause I think the search system is pretty annoying.
I think it is possible with the script you are using, if I understand it correctly it is tied to the input field with id = "searchbox".

It doesn't listen for the submit event so this will probably work:
This is the current code:

Code: Select all

<form action="">
  <input type="text" id="searchBox" />
</form>
Just change it to this (just an example):

Code: Select all

<form action="awesomeSeachResults.php" method="get">
  <input type="text" name="searchQuery" id="searchBox" />
</form>
Then when you press enter it will redirect you to awesomeSeachResults.php&searchQuery=
So need to make that page (awesomeSeachResults.php) which displays search results in an unordered list.

Advantages:
- Faster
- More results

(Also I forgot to mention no hacking of the javascript required :D)

Re: Search box

Posted: Thu Oct 25, 2012 9:45 am
by nico
Thanks, I made it and put it on the site, you can check it.

Re: Search box

Posted: Thu Oct 25, 2012 1:25 pm
by stealth
nico wrote:Thanks, I made it and put it on the site, you can check it.
Yes! Now it's awesome :)