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

231
Vistas
How to get Current State of checkbox in thymeleaf th:onclick?

I have a Checkbox and I call a function with th:onclick. This function takes the Value of checkbox After I Click it. But I don't Know How to Get the State of Checkbox Inside of th:onclick. the code looks like this:

<input type="checkbox" th:onclick="'javascript:userSettings(' + ${user.id} + ', this );'" th:checked="${user.enabled}" />

my function:

function userSettings(userId,userChk) { alert(userChk)}

After Clicking the Checkbox, the Value of "userChk" is undefiend.

How Can I Fix That?

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

0

My Fault, I forgot to get the Value of It:

function userSettings(userId,userChk) { alert(userChk.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