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

92
Views
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 answers
Answer question

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 Report

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 Report

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 Report
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!