Share ideas, ask questions, and get feedback about developing for ProcessMaker
Forum rules: Please post new questions under "Developing processes & programming" for ProcessMaker 2 or 3.
User avatar
By tellesmg
#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
By Ironguts25
#783776
Looks like you're using the wrong event, try using the onload event instead. onchange will only execute when the state of a form element changes. e.g. the user selects an option.

A 1xBet clone script is a customizable software so[…]

A Bustabit clone script is a pre-made software sol[…]

Are you looking for ways to pay someone to write m[…]

BC.Game Clone

BC.game clone is a replica of the original BC.game[…]