»
AnglaisFran�aisVietnamien

Imprimer - Dans la page de recherche-Option - JavaScriptBank.com

Version compl�te: jsB@nk » Utilitaire » Recherche de code » Dans la page de recherche-Option
URL: https://www.javascriptbank.com/in-page-search-option.html

Dans la page de recherche-Option © JavaScriptBank.comAjouter un compte Google/Yahoo search option à vos pages Web. L'utilisation de boutons radio, vous pouvez search chaque moteur individuellement ou les deux en même temps.

Version compl�te: jsB@nk » Utilitaire » Recherche de code » Dans la page de recherche-Option
URL: https://www.javascriptbank.com/in-page-search-option.html



JavaScript
<script type=text/javascript>// Created by: Ivan Iraola :: http://www.cybexmag.comfunction DoSearch() {  var Flag = 0;  if (document.ToolBox.SearchOption[0].checked==true) {    var Flag = 1;    var Engine = document.ToolBox.SearchOption[0].value;    var Query = document.ToolBox.SearchBox.value;    var locName = "http://www.google.com/search?hl=en&q=";      if (Query == "") {        alert("Please enter a search term");        return;      }    location.href = (locName + Query)  }  if (document.ToolBox.SearchOption[1].checked==true) {    var Flag = 1;    var Engine = document.ToolBox.SearchOption[1].value;    var Query = document.ToolBox.SearchBox.value;    var locName = "http://search.yahoo.com/search?p=";      if (Query == "") {        alert("Please enter a search term");        return;      }    location.href = (locName + Query)  }  if (document.ToolBox.SearchOption[2].checked==true) {    var Flag = 1;    var Engine = document.ToolBox.SearchOption[2].value;    var Query = document.ToolBox.SearchBox.value;      if (Query == "") {        alert("Please enter a search term");        return;      }    var searchPage = "<HTML>";      searchPage += "\n";      searchPage += "<FRAMESET ROWS=\"50%,50%\">";      searchPage += "\n";      searchPage += "<FRAME SRC=\"http://www.google.com/search?hl=en&q=" + Query + "\">";      searchPage += "\n";      searchPage += "<FRAME SRC=\"http://search.yahoo.com/search?p=" + Query + "\">";      searchPage += "\n";      searchPage += "</FRAMESET>";      searchPage += "\n";      searchPage += "</HTML>";      document.write(searchPage);  }  if (Flag == 0) {    alert("Please select a search engine");  }}</script><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<form name="ToolBox" style="line-height: 2em;">Enter search term(s): <input type="text" name="SearchBox" size="22"><br><input type="radio" name="SearchOption" value="Google">Google  <input type="radio" name="SearchOption" value="Yahoo">Yahoo  <input type="radio" name="SearchOption" value="Both">Both  <button type="button" onclick="DoSearch()">Search</button></form><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->