Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

105
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda