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

85
Vistas
Automatically have all checkboxes selected on page load

I can find a lot of code for a "select all" option, but what I want is more straightforward. I want the WpForms checkboxes all checked by default on page load, not when a button is pressed. I want them all selected so users only have to de-select the few they don't want.

I am trying to use this code currently, please help.

$(':checkbox').each(function() {
    this.checked = true;                        
});

Thanks for any help. I posted the above code into a javascript wordpress plugin but it didn't help.

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

0

on HTML just add checked as attribute for input type="checkbox"

<input type="checkbox" name="test1" value="test1" checked> I'm Check<br>
<input type="checkbox" name="test2" value="test2" checked> I'm Check<br>
<input type="checkbox" name="test3" value="test3"> I'm not Check<br>
<input type="checkbox" name="test4" value="test4" checked> I'm Check

about 4 years ago · Juan Pablo Isaza Denunciar

0

First of all my friend, you are not a retard ! You just need to gain more experience ;)

You should get checkboxes like this in Jquery and check them all:

$('input[type=checkbox]').each(function () {
    this.checked = true;
});

This might help you.

About that wordpress plugin that you mentioned I have to say that you should put this piece of code in a script tag and a html file which has the checkBoxes in it.

about 4 years ago · Juan Pablo Isaza Denunciar

0

you can use jquery for this solution

$(document).ready || use for apply any function on load page

Solution:

<input type="checkbox" name="test1" value="test1"> Test 1<br>
<input type="checkbox" name="test2" value="test2"> Test 2<br>
<input type="checkbox" name="test3" value="test3"> Test 3<br>
<input type="checkbox" name="test4" value="test4"> Test 4


$(document).ready(function(){
$('[type="checkbox"]').each(function(){
$(this).attr("checked","checked");
});
})
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