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

127
Vistas
adding parameter from html form to jquery string

I am trying to add to the below async call in javascript which sends parameter q=<query>, the second parameter l=<lquery>, but I don't see it sent out, checked in dev tools console

var searchbox = $('input#search');
var langquery = $('input#fav_language');
var timer = 0;

// Executes the search function 250 milliseconds after user stops typing
searchbox.keyup(function () {
  clearTimeout(timer);
  timer = setTimeout(search, 250);
});

async function search() {
  // Clear results before searching
  noresults.hide();
  resultdiv.empty();
  loadingdiv.show();
  // Get the query from the user 
  let query = searchbox.val();
  // Only run a query if the string contains at least three characters
  if (query.length > 2) {
    let lquery = langquery.val();   
    // Make the HTTP request with the query as a parameter and wait for the JSON results
    let response = await $.get(apigatewayendpoint, { q: query, l: lquery, size: 25 }, 'json');

the html body is below. i've tried referring to the radio form id an to the input name, both didn't worked

<body>
  <h1>InfoLang - Movie Plot At Your Language</h1>
        
  <form id="lang">
  <p>Please select language:</p>
  <input type="radio" id="it" name="fav_language" value="Italian">
  <label for="it">Italian</label><br>
  <input type="radio" id="fr" name="fav_language" value="French">
  <label for="fr">French</label><br>
  <input type="radio" id="he" name="fav_language" value="Hebrew">
  <label for="he">Hebrew</label>
  <br>  
  </form>
  
   
  <hr>
  <input id="search" autocomplete="off" placeholder="Search your movie" align="center">
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

i got this by-

if (query.length > 2) {
    let lquery
    if (document.getElementById('it').checked) lquery = 'it'
    if (document.getElementById('fr').checked) lquery = 'fr'
...

and for the display

let title = results[item]._source.title
        if (lquery == 'it') plot = results[item]._source.description_it
        if (lquery == 'fr') plot = results[item]._source.description_fr
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