Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

Script function in HTML is invoked when 'ENTER' Key is pressed

SA-2425

Summary



Developer has built a section that references a HTML fragment. The HTML fragment has markup which displays 2 icons on the UI screen
and a JavaScript function X to be invoked when the icons are clicked. When user navigates to the portion of the screen that displays these icons and presses 'ENTER' key, the javascript function configured on the 'ONCLICK' of the icons gets triggered.

Error Messages



None


Steps to Reproduce



Build a section that references a HTML fragment. Put HTML markup which displays 2 icons on the UI screen and a JavaScript function X to be invoked when the icons are clicked. At runtime, navigate to the portion of the screen that displays these icons and presses 'ENTER' key.


Resolution



The issue can be resolved by doing the below:

a) Create a new JS file rule and copy the script function from HTML fragment rule into this JS file.
b) Include the JS file under 'Scripts and Styles' tab of the harness.
c) Configure the section to include an icon instead of the HTML fragment rule and configure ONCLICK of the icon to 'Run a Script' function.

Published January 31, 2016 - Updated October 8, 2020

Was this useful?

0% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us