The onsubmit event runs client-side code before a response is submitted to a Profound UI Rich Display File screen or a Genie screen. This typically occurs when a function key is pressed or a button/hyperlink is clicked. If the expression evaluates to false, the response is not submitted.
Then, the following can be placed onto the onsubmit event:
For Genie, a variable named 'key' is available on the event. This can be used to determine which key was pressed.
- "SYSRQ" if the system request key was pressed.
- "ATTN" if the attention key was pressed.
- "ERRORHELP" if the help key was pressed while a message was displayed in the error line.
- an AID code if any other key was pressed. See here for the valid AID codes:
For Rich Displays, the event can be specified as a function name only. If used in this way, a response object containing all the values is passed to the specified function. The function can interrogate and even change the response values. For RPG Open Accesss programs, the names in the object are stored as "FORMAT.FIELDNAME", where the format and the field name are capitalized.
Your function can be declared in an external file as follows:
The onsubmit event would only contain the name of the function name: