2011-10-02 76 views
1

我想创建一个搜索输入到一个网站,将搜索条件添加到网址的末尾。添加搜索条件从表单到搜索网址

这是有问题的网址:

http://apps.ticketbiscuit.com/ticketbiscuit.website/LyricTheatreOxford/Search/

您可以通过添加搜索词的url eg./Search/robert &结束时,如果字符串中包含他们所需要多个单词手动搜索与“%20”分隔,例如/搜索/罗伯特%20Earl。

这是我当前的搜索形式:

<form method="get" action="http://apps.ticketbiscuit.com/ticketbiscuit.website/LyricTheatreOxford/Events/Search/" id="searchform" role="search"> 
    <input type="text" value="Search Events" name="s" id="s" onFocus="if (this.value == 'Search Events') {this.value=''; this.style.color='#000000';}"/> 
    <input type="hidden" name="sitesearch" value=""/> 
</form> 

如果键入凯文到输入,形式返回这个网址:

http://apps.ticketbiscuit.com/ticketbiscuit.website/LyricTheatreOxford/Search/?s=Kevin&sitesearch=

我知道我需要一些JavaScript在那里处理搜索和建立正确的网址,但我不知道需要什么。

任何人有任何想法?如果这已在其他地方得到解答,道歉。我长时间环顾四周,但找不到任何东西。

回答