The code is relatively simple and directly pasted with code,
<% @ Page Language = "C #" autoeventwireup = "true" codefile = "searchtype. aspx. cs" inherits = "ui_searchtype" %>
<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML xmlns = "http://www.w3.org/1999/xhtml">
<Head runat = "server">
<Title> Search Engine selection-by wangtao </title>
<Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8"/>
<SCRIPT type = "text/JavaScript" src = "../MISC/JS/CORE/jquery. js"> </SCRIPT>
</Head>
<Body>
<SCRIPT type = "text/JavaScript">
Function dosearch (){
If ($ ('# s_keys'). Val () = '')
{Alert ('Enter the search keyword ');}
Else
{
VaR v_searchtype = $ ("input [name = 'searchtype']: checked"). Val ();
If (v_searchtype = 'SITE ')
{V_href = 'HTTP: // search.site.com/site.aspx? Keys = '+ $ (' # s_keys '). Val ();}
Else if (v_searchtype = 'Google ')
{V_href = 'HTTP: // www.google.cn/search? Q = '+ $ (' # s_keys '). Val ();}
Else if (v_searchtype = 'baidu ')
{V_href = 'HTTP: // www.baidu.com/s? WD = '+ $ (' # s_keys '). Val ();}
Window. Location. href = v_href;
}
}
</SCRIPT>
<Div>
<Form ID = "formsearch" onsubmit = "dosearch (); Return false;" Action = "">
<Input type = "text" id = "s_keys"/>
<Span>
<Input type = "radio" name = "searchtype" value = "Site" Checked = "checked" id = "site_search"/>
<Label for = "site_search"> intra-Site Search </label>
<Input type = "radio" name = "searchtype" value = "google" id = "google_search"/>
<Label for = "google_search"> Google search </label>
<Input type = "radio" name = "searchtype" value = "Baidu" id = "baidu_search"/>
<Label for = "baidu_search"> Baidu search </label>
</Span>
<Input type = "Submit" id = "s_search" value = "Search"/>
</Form>
</Div>
</Body>
</Html>