-1
Hello Folks I am in need of a help on the following question:
When I select a checkbox the send button will not be available, but if you select one or more is available. follow the code:
<div class="selecionar-todos">
<input class="form-check-input" name="tecnologia" type="checkbox" value="" id="od" > SELECIONAR TODOS
</div>
<div class="grupos-imputs">
<input class="form-check-input" name="tecnologia" type="checkbox" value="" id="um"> UM
</div>
<div class="grupos-imputs">
<input class="form-check-input" name="tecnologia" type="checkbox" value="" id="dois"> DOIS
</div>
<div class="grupos-imputs">
<input class="form-check-input" name="tecnologia" type="checkbox" value="" id="tres"> TRÊS
</div>
<button type="button" class="btn btn-success">ENVIAR</button>
/* SCRIPT SELECIONAR TODOS (FUNCIONANDO) */
<script>
$("#od").change(function(){
if(this.checked){
$(":checkbox[name=tecnologia]")
.attr("checked","checked");
} else {
$(":checkbox[name=tecnologia]")
.removeAttr("checked");
}
});
</script>
SCRIPT LIBERAR BOTAO QUE FUNCIONA COM INPUT TYPO TEXT (FUNCIONANDO) que tentei implementar no tipo CHECKBOX
<script>
validate();
$(':checkbox[name=tecnologia]').change(validate);
function validate() {
if (
$(':checkbox[name=tecnologia]').val().length > 1) {
$("button[type=submit]").prop("disabled", false);
}
else {
$("button[type=submit]").prop("disabled", true);
}
}
</script>
Hello friend, thank you for the answer, but I did the test here and it didn’t work, did you run the adjustment? my impression is that it is not . length not used. now I can’t remember which to use.
– Rondinelle Freire
I modified it, try it with this
– Eddy Albines
ball show, it worked out! Thanks.
– Rondinelle Freire
Pleasure to help
– Eddy Albines