form control event is not working(Bahmni)

Application Name: Bahmni

Question: In Bahmni i have created a form and none of the control events are working. one of the sample control event that i am using.

function(form){ let count = 0;

var controlid = [1,2,3,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20];

for(let i = 0; i < controlid.length; i++){ if (form.getById(controlid[i]).getValue() === ‘Just little’) count++; }

form.get(‘Just little’).setValue(count);


any clue? what am I missing?