-
-
Save suissa/0759d092c422742d159bcdeb8410171b to your computer and use it in GitHub Desktop.
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
$(function() { | |
const medida_el = document.querySelector('#validacao_medida_id_val') | |
const dimensao_el = document.querySelector('#validacao_dimensao_id_val') | |
console.log(medida_el) | |
console.log(dimensao_el) | |
const changeMedida = (event) => { | |
const cubo_val = $('#validacao_cubo_id_val :selected').text(); | |
console.log('cubo_val', cubo_val) | |
if (opcoes_cubo_val) { | |
$('#validacao_medida_id_val').html(opcoes_cubo_val); | |
} else { | |
$('#validacao_medida_id_val').empty(); | |
} | |
}); | |
const changeDimensao = (event) => { | |
} | |
medida_el.addEventListener('change', changeMedida) | |
dimensao_el.addEventListener('change', changeDimensao) | |
// const medidas_val = medida_el; | |
// const dimensoes_val = dimensao_el; | |
// console.log("medidas: "+medidas_val); | |
// console.log("dimensoes: "+dimensoes_val); | |
// $(document.body).on('change', '#validacao_cubo_id_val', function() { | |
// const cubo_val = $('#validacao_cubo_id_val :selected').text(); | |
// const opcoes_cubo_val = medidas_val.filter("optgroup[label='" + cubo_val + "']"); | |
// // $(document.body).on('change', '#validacao_medida_id_val', function() { | |
// // var medida_val, opcoes_med_val; | |
// // medida_val = $('#validacao_medida_id_val :selected').text(); | |
// // opcoes_med_val = $(dimensoes_val).filter("optgroup[label='" + medidas_val + "']").html(); | |
// // if (opcoes_med_val) { | |
// // $('#validacao_dimensao_id_val').html(opcoes_med_val); | |
// // $('#validacao_dimensao_id_val').parent().show(); | |
// // } else { | |
// // $('#validacao_dimensao_id_val').empty(); | |
// // $('#validacao_dimensao_id_val').parent().hide(); | |
// // } | |
// // }); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment