Question

18
Replies
3650
Views
OZKANMECH Member since 2014 8 posts
Infosys
Posted: 5 years ago
Last activity: 5 years ago
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 Interface System Administration
Moderation Team has archived post
Share this page LinkedIn