Question

1
Replies
806
Views
Close popover
Srinivas Sarda (SSrinivas)
Coforge
Srinivas Sarda
Coforge
IN
SSrinivas Member since 2015 52 posts
Coforge
Posted: May 16, 2018
Last activity: May 21, 2018
Closed

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","", "", "&amp;=", "", ",",":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***

Low-Code App Development Data Integration Java and Activities User Experience
Moderation Team has archived post,
Close popover This thread is closed to future replies. Content and links will no longer be updated. If you have the same/similar Question, please write a new Question.