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.

The Quantum AI Project Trading Platform stands out[…]

I can help you with the top solution to import OST[…]

If you have an email and want to open it in PST fo[…]

Coinbase clone software is a ready-to-go software […]