Question

18
Replies
3749
Views
Close popover
Ozkan Mechmetali (OZKANMECH)
Infosys

Infosys
BE
OZKANMECH Member since 2014 8 posts
Infosys
Posted: September 3, 2015
Last activity: September 8, 2015
Closed
Solved

How can I get a custom button's id in Pega 7?

Hello everyone,

I am using a javascript to capture an enter key event from the keyboard where I would like to simulate the behavior of a button click. The custom button is created within a section and I use the following js in a HTML tab of a different section...

<SCRIPT TYPE="text/javascript">

$(document).keypress(function(event){

var keycode = (event.keyCode ? event.keyCode : event.which);
if(keycode && keycode == '13'){

document.getElementById('button1').click();

}
});

</SCRIPT>

<div onKeyPress="return keypress(event)">

However, I am not able to locate anywhere the button id and hence the getElementById always return null (empty) or undefined id.

Anyone has encounter similar difficulty is Pega 7?

Thanks a lot in advance.

User Experience System Administration
Moderation Team has archived post