Search box

Everything related to the timeruns.net scoreboard
Post Reply
nico
Site Admin
Posts: 168
Joined: Mon Nov 07, 2011 11:40 pm

Search box

Post 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.
--
>Nico*
Contact: pm me
stealth
Posts: 140
Joined: Fri Dec 09, 2011 6:02 pm

Re: Search box

Post 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)
nico
Site Admin
Posts: 168
Joined: Mon Nov 07, 2011 11:40 pm

Re: Search box

Post 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
--
>Nico*
Contact: pm me
stealth
Posts: 140
Joined: Fri Dec 09, 2011 6:02 pm

Re: Search box

Post 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)
nico
Site Admin
Posts: 168
Joined: Mon Nov 07, 2011 11:40 pm

Re: Search box

Post by nico »

Thanks, I made it and put it on the site, you can check it.
--
>Nico*
Contact: pm me
stealth
Posts: 140
Joined: Fri Dec 09, 2011 6:02 pm

Re: Search box

Post by stealth »

nico wrote:Thanks, I made it and put it on the site, you can check it.
Yes! Now it's awesome :)
Post Reply