dimanche 18 avril 2021

Using checkboxes to select multiple sites to search

I am improving a search tool I have built for work. I have had a request to add checkboxes so rather than opening the search term in all available sites, I want it to just open the sites with selected checkboxes. At the moment I have it still just doing the submit all. And i cannot find anything that relates to this problem.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="icon" type="image/png" href="img/favicon.png" sizes="32x32" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="css/osint.css"/>

<title>Multi-search Tool</title>
</head>

<body topmargin=0 leftmargin=0 rightmargin=0 marginwidth="0" marginheight="0" bgcolor=white>
<div class="header">
    <div class="header-top">

        <!-- A.1 SITENAME -->
        <a class="sitelogo" href="index.html" title="Home"></a>
        <div class="sitename">
        <h1><a href="index.html"><img src="img/banner.png" alt="" width="800" height="125" /></a></h1>
      </div>
    </div>
    <!--VPN warning banner-->
    <div class="vpnWarning">
        <h3>Please ensure you have connected to VPN before using this tool</h3>
    </div>
</div>

<table>
<thead>
    <tr>
        <th colspan="3">Multi-Search Tool</th>
    </tr>
</thead>
<tbody>
    <tr>
        <td>Search Engines</td>
        <td>Social Media</td>
        <td>Other</td>
    </tr>
    <tr>
        <td><input type="checkbox" name="color" value="Google"> Google</td>
        <td><input type="checkbox" name="color" value="Facebook"> Facebook</td>
        <td><input type="checkbox" name="color" value="Other"> Reddit</td>
    </tr>
    <tr>
        <td><input type="checkbox" name="color" value="Bing"> Bing</td>
        <td><input type="checkbox" name="color" value="Twitter"> Twitter</td>
        <td><input type="checkbox" name="color" value="Reddit"> Other</td>
    </tr>
    <tr>
        <td><input type="checkbox" name="color" value="DuckDuckGo"> DuckDuckGo</td>
        <td><input type="checkbox" name="color" value="LinkedIn"> LinkedIn</td>
        <td><input type="checkbox" name="color" value="Other"> Other</td>
    </tr>
    <tr>
        <td><input type="checkbox" name="color" value="Yahoo"> Yahoo</td>
        <td><input type="checkbox" name="color" value="Instagram"> Instagram</td>
        <td><input type="checkbox" name="color" value="Other"> Other</td>
    </tr></tbody></table>




<script type="text/javascript">
 function doall(all) {
 window.open('http://google.com/search?q=' + 'intext:"' + all + '"', 'googlewindow');
 window.open('http://bing.com/search?q=' + all, 'bingwindow');
 window.open('http://search.yahoo.com/search?p=' + all, 'yahoowindow');
 window.open('https://duckduckgo.com/?q=' + all, 'ddgwindow');
 window.open('https://twitter.com/search?q=' + all, 'twitterwindow');
 window.open('https://www.facebook.com/search/top/?q=' + all + '&epa=SEARCH_BOX', 'facebookwindow');
 window.open('http://google.com/search?q=' + 'site:linkedin.com" '+ all +'"' , 'linkedinwindow');
 window.open('https://reddit.com/search/?q=' + all, 'redditwindow');
 window.open('https://www.google.com/search?ei=eau4WurGOMz1kwW825fYDw&q=%22' + all + '%22+site%3Ainstagram.com&oq=%22' + all + '%22+site%3Ainstagram.com&gs_l=psy-ab.3...13286.13286.0.13901.1.1.0.0.0.0.181.181.0j1.1.0....0...1c.1.64.psy-ab..0.0.0....0.JovkcTLEugo','instagramwindow');}</script>

  <form onsubmit="doall(this.all.value); return false;">
    <input name="all" id="ipall" size="40" value="" /><br>
    <input type="submit" style="width:120px" value="Submit" />
    (Allow Pop-ups)<br /><br />
  </form>
  <button id="btn">Check / uncheck All</button><!--<button id="btn1">Use Last</button>--><button 
onclick="document.getElementById('ipall').value = ''">Clear input field</button>

 <script src="js/DFT.js"></script>
</body>



Aucun commentaire:

Enregistrer un commentaire