Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.

Moderator: amosbatto

By as13969
#812949
Dear ProcessMaker Experts,

I'm currently using PM version 2.5.2 and created a JS for my checkgroup that if the 2nd items is checked it will show the textarea field.
Below is my JS but it seems the onlick, click, change or onchange is not working. The script is working when the form loads but when I tried to check
the 2nd item it does not function. I even tried the leimund JS framework but also not working.

Could you please help me? :roll:
Code: Select all
function checkSIMExternalTower () {
 var arrCheck = document.getElementsByName('form[SimulatorTypeCheck][]');
 var report = "";
 for (var i = 0; i < arrCheck.length; i++)
 {
    if (arrCheck[i].checked)
       report = arrCheck[i].value;

    if (report == "SimBodyForm") {
       showRowById("SimulatorExternalTower");
    } else {
       hideRowById("SimulatorExternalTower");
    }
 }
}
checkSIMExternalTower ();
//leimnud.event.add(document.getElementsByName('form[SimulatorTypeCheck][]'), "change", checkSIMExternalTower );
document.getElementsByName('form[SimulatorTypeCheck][]').onchange = checkSIMExternalTower;
User avatar
By amosbatto
#812969
getElementsByName() returns an array, so you have to access an element in the array to apply the onchange.
If you want the second item in the checkgroup, then try this:
Code: Select all
document.getElementsByName('form[SimulatorTypeCheck][]')[1].onchange = checkSIMExternalTower;

Hi, Is there any way to show my custom column only[…]

Send for clarification

Hi, I know this is an old post but i could not fin[…]

add dropdown to search process

Please replay if there is any solution!!!!

Amosbatto, PMUsers.com is down.

Hi Amos, I appreciate you setting up a tips and t[…]