Multi-search, single search bar HTML -


as title states, i'm trying incorporate many searches 1 search bar. more specifically, google , amazon. have setup radio option set site search when 1 selected. code have:

<form method="get" action="http://www.google.com/search">      <div align="center" style="font-size:75%">         <input type="text"   name="q" size="25" maxlength="255" value="" />         <input type="submit" value="google or amazon search" /></br>         <input type="radio"  name="sitesearch" value="" />the web         <input type="radio"  name="sitesearch" value="yoursite.com" checked />this site     </div>    </form> 

i have form amazon, i'm unsure how code 1 search bar.

<form action="http://amazon.com/s/ref=nb_sb_noss" method="get" target="_blank">     <input type="text" id="twotabsearchtextbox" name="field-keywords">     <input type="submit" value="search" class="nav-submit-input"> </form> 

use javascript change actual form action in page's dom (and other parameters, if needed), depending on user selection (use onclick event on radio montior change example). simple that. won't able in pure html without using kind of proxy server redirect requests , return results appropriately.

document.your-form.action = (google_selected) ? "http://www.google.com/search" : "http://amazon.com/s/ref=nb_sb_noss"; 

etc.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -