unable to trigger on change event from javascript
Hi Everyone,
using javascript I'm trying to set the value and trigger the onchange event configured on Dropdown. Below is the markup of select.
<select name="$PColorsPage$pColors" id="Colors" style="width: auto;" data-ctl='["Dropdown"]' data-change='[["refresh", ["thisSection","", "", "&=", "", ",",":event","","ColorsPage"]]]'><option title="Select..." value="">Select...</option><option title="Red" value="2">Red</option><option title="Yellow" value="3">Yellow</option></select>
Below is js code I have tried in console. But its not triggering the fireEvent method.
var element = document.getElementById('Colors');
element.selectedIndex=2;
pega.util.Event.fireEvent(element,'change');
The reason I'm trying to explicitly trigger the event because of Automation unable to identify the onchange event, as pega is adding the event to data-change attribute.
Thanks
Srinivas
***Edited by Moderator Marissa to update categories***