Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Multiple Search Options - Radio Buttons Instead Of Drop Down List

  1. Mar 26, 2007 #1
    The tutorial on how to make a search form with multiple search options was excellent!


    However, is it possible to use radio buttons instead of a drop-down list?Can someone be kind enough to show me the code for it?

    Million thanks.
  2. jcsd
  3. Mar 26, 2007 #2


    User Avatar
    Science Advisor

    You can do for example:
    Code (Text):

        <script language="JavaScript">eng = 'http://www.google.com/search?q=';</script>  
        <input type="text" id="searchterms">
        <input type="button" value="Search" onload="" onclick="window.location = eng + escape(document.getElementById('searchterms').value); return false;">
        <br />Search:
        <input type="radio" onclick="eng = this.value;" checked name="sengines" value="http://www.google.com/search?q=" />Google
        <input type="radio" onclick="eng = this.value;" name="sengines" value="http://www.altavista.com/web/results?q=" />Alta Vista
        <input type="radio" onclick="eng = this.value;" name="sengines" value="[PLAIN]http://www.dogpile.com/info.dogpl/search/web/"[/PLAIN] [Broken] />Dogpile
        <input type="radio" onclick="eng = this.value;" name="sengines" value="http://search.yahoo.com/search?p=" />Yahoo!    
    Last edited by a moderator: May 2, 2017
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook