Multiple Search Options - Radio Buttons Instead Of Drop Down List

Click For Summary
SUMMARY

The discussion focuses on implementing a search form using radio buttons instead of a drop-down list for selecting search engines. The provided JavaScript code allows users to input search terms and choose from multiple search engines, including Google, Alta Vista, Dogpile, and Yahoo!. This approach enhances user experience by offering a more interactive selection method. The tutorial referenced is from MediaCollege, which provides a foundational understanding of multi-search forms.

PREREQUISITES
  • Basic understanding of HTML structure
  • Familiarity with JavaScript syntax and functions
  • Knowledge of event handling in JavaScript
  • Experience with form elements in web development
NEXT STEPS
  • Explore advanced JavaScript event handling techniques
  • Learn about form validation in JavaScript
  • Investigate the use of AJAX for dynamic search results
  • Study user interface design principles for web forms
USEFUL FOR

Web developers, UI/UX designers, and anyone interested in enhancing search functionality on websites.

jleung
Messages
3
Reaction score
0
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.
 
Technology news on Phys.org
You can do for example:
Code:
<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="[PLAIN]http://www.dogpile.com/info.dogpl/search/web/"[/PLAIN]  />Dogpile
    <input type="radio" onclick="eng = this.value;" name="sengines" value="http://search.yahoo.com/search?p=" />Yahoo!    
</body>
</html>
 
Last edited by a moderator:

Similar threads

  • · Replies 15 ·
Replies
15
Views
3K
  • · Replies 2 ·
Replies
2
Views
551
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 3 ·
Replies
3
Views
5K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 80 ·
3
Replies
80
Views
69K