Created
March 27, 2024 14:33
-
-
Save dantetesta/f6673d6991205ca2c05485e9638648f7 to your computer and use it in GitHub Desktop.
Limita Taxonomia no Backend a 1 item apenas
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
jQuery(document).ready(function($) { | |
// Função para tratar a mudança nos checkboxes de 'sexo' e 'cursos' | |
function tratarMudancaCheckbox() { | |
// Encontra o grupo do checkbox alterado ('sexo' ou 'cursos') | |
var grupo = $(this).closest('.tabs-panel'); | |
// Desmarca todos os outros checkboxes no mesmo grupo | |
$('input[type="checkbox"]', grupo).not(this).prop('checked', false); | |
} | |
// Anexa a função ao evento de mudança dos checkboxes de 'sexo' e 'cursos' | |
$('#sexochecklist input[type="checkbox"], #cursoschecklist input[type="checkbox"]').on('change', tratarMudancaCheckbox); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment