Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

207
Views
Agregar URL de casillas de verificación seleccionadas

Las casillas de verificación seleccionadas se agregan al final de la URL, pero console.log regresa vacío. ¿Cuál podría ser la razón de ésto?

HTML:

 <div class="panel-body"> <div class="rowElem"> <input type="checkbox" name="chbox" id="" value="Color #1"> <label>Color #1</label> </div> <div class="rowElem"> <input type="checkbox" name="chbox" id="" value="Color #2"> <label>Color #2</label> </div> <div class="rowElem"> <input type="checkbox" name="chbox" id="" value="Color #3"> <label>Color #3</label> </div> </div>

JS:

 $('input[type="checkbox"]').on('change', function(e){ var data = {}, fdata = [], loc = $('<a>', {href:window.location})[0]; $('input[type="checkbox"]').each(function(i){ if(this.checked){ if(!data.hasOwnProperty(this.name)){ data[this.name] = []; } data[this.name].push(this.value); } }); $.each(data, function(k, v){ fdata[k] = [v.join(',')]; }); fdata = fdata.join('&'); console.log(fdata); });

Muestra: https://example.com/?foo=1,2,3,4&.. .

Manifestación

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!