- Fri Jul 10, 2015 2:01 pm
#783685
Hi everyone
I´m create a js code in my dynaform but the code only runs after I manually change the value in my dropdown.
My dynaform dont run my javascript code when its load..
function showOrHideField() {
if ($('#reporta_inconformidade').getValue() == ['1']) {
$('#reporta_status_resolucao').show();
$('#reporta_descricao').show();
}
else {
$('#reporta_status_resolucao').hide();
$('#reporta_descricao').hide();
}
}
document.getElementById('form[reporta_inconformidade]').onchange = showOrHideField;
showOrHideField(); //execute when DynaForm loads
I´m create a js code in my dynaform but the code only runs after I manually change the value in my dropdown.
My dynaform dont run my javascript code when its load..
function showOrHideField() {
if ($('#reporta_inconformidade').getValue() == ['1']) {
$('#reporta_status_resolucao').show();
$('#reporta_descricao').show();
}
else {
$('#reporta_status_resolucao').hide();
$('#reporta_descricao').hide();
}
}
document.getElementById('form[reporta_inconformidade]').onchange = showOrHideField;
showOrHideField(); //execute when DynaForm loads