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

104
Views
Keep checkboxes/radio buttons with same name checked after page refresh

I'm creating a Bootstrap website in which I have a page with multiple checkbox and radio button groups. I'm using Bootstrap's built in functionality to create groups of radio buttons, meaning that through the use of the same "name" attribute (but different "value" attributes) I'm able to switch selection between radio buttons. I'm also giving the same "name" attribute to the checkboxes I want to group (and different "value" attributes to differentiate them), in order to be able to easily create Javascript and/or PHP based on the current selection.

I found an article - http://www.marcorpsa.com/ee/t2641.html - and from what I can see, the script on the article only works if the value of the "name" attribute of the checkboxes/radio buttons is different from checkbox/button to checkbox/button (which can't happen in case I want to group them easily). To be clear, this script works perfectly if I give a unique "name" attribute to each of my checkboxes/radio buttons.

I also found some articles here (on Stack Overflow), but unfortunately I couldn't find anything that worked on my situation.

My question is: how can I modify the script on the article in order to keep all the checkboxes/buttons checked after the page reloads? Or do you have another solution?

Let me know if you need more information (like screenshots, code or anything else).

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Probably store wheter they are checked in a local/session storage. Then when refreshed read the storage to check the box again.

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!