Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

150
Vistas
How to Make a Search Form With Multiple Search Options

I am trying to create a search form with a dropdown menu that allows visitors on a site to choose on which site to perform their search.

The dropdown menu offers a selection of sites to search.

So far, I got this far : https://biblio.brossard.ca/boite-de-recherche-test/.

Everything works great except when I use words with accented letters (é, ê, à, î, etc.) in the search box.

Here is the HTML code :

<form name="searchform" id="searchform" class="search-form" onSubmit="return dosearch();">
<div class="search-form-wrap">
<div class="selecteur">
<select name="sengines">
<option id="options" value="https://biblio.brossard.ca/?s=">Site Web</option>
<option id="options" value="https://catalogue.brossard.ca/query?q=" selected>Catalogue</option>
<option id="options" value="https://bibliothequemunicipaledebrossard.on.worldcat.org/v2/search?queryString=">Catalogue international</option>
</select></div><input type="text" name="searchterms" class="search-form-input" style="border-radius: 0 25px 25px 0; width: 70%; display: inline;" placeholder="Saisissez les termes de votre recherche."><input type="submit" name="SearchSubmit" id="searchsubmit" class="button submit-button" value="&#xf179;" />
</div>
</form>

And here is the javascript code :

<script type="text/javascript">
function dosearch() {
var sf=document.searchform;
var submitto = sf.sengines.options[sf.sengines.selectedIndex].value + escape(sf.searchterms.value);
window.location.href = submitto;
return false;
}
</script>

So, how could I make a search form in which visitors on my site can select where to perform their search from a selection in a dropdown menu and the search will work with both words with and without accented characters?

Many thanks for your help.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

First thing first The escape() function is deprecated. Although escape() is not strictly deprecated (as in "removed from the Web standards").

The escape() function computes a new string in which certain characters have been replaced by a hexadecimal escape sequence.

escape('abc123');     // "abc123"
escape('äöü');        // "%E4%F6%FC"
escape('ć');          // "%u0107"

// special characters
escape('@*_+-./');    // "@*_+-./"

The escape function is a property of the global object. Special characters are encoded with the exception of: @*_+-./

The hexadecimal form for characters, whose code unit value is 0xFF or less, is a two-digit escape sequence: %xx. For characters with a greater code unit, the four-digit format %uxxxx is used.

Reference

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda