1. Not finding help here? Sign up for a free 30min tutor trial with Chegg Tutors
    Dismiss Notice
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!

    http://www.mediacollege.com/internet/javascript/form/multi-search.html

    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

    -Job-

    User Avatar
    Science Advisor

    You can do for example:
    Code (Text):

    <html>
    <body>
        <script language="JavaScript">eng = 'http://www.google.com/search?q=';</script>  
        For:
        <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="http://www.dogpile.com/info.dogpl/search/web/" />Dogpile
        <input type="radio" onclick="eng = this.value;" name="sengines" value="http://search.yahoo.com/search?p=" />Yahoo!    
    </body>
    </html>
     
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: Multiple Search Options - Radio Buttons Instead Of Drop Down List
  1. Linked List (Replies: 9)

  2. Linked list (Replies: 12)

Loading...