Skip to end of metadata
Go to start of metadata

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.

Examples:

In the following examples the JavaScript function validateNewsletterSettings() is used to validate user input when a screen is submitted.

The function can be placed into an external JavaScript file:

Then, the following can be placed onto the onsubmit event:

Alternatively, if you wanted to avoid using an external JavaScript file, both the function and the call to the function can be be placed onto the onsubmit event, as follows:

For Genie, a variable named 'key' is available on the event.  This can be used to determine which key was pressed.

Example:

The variable 'key' is a JavaScript string that will contain one of the following values:

  • "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:

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/CO2E2001/16.2.1?DT=19950629163252

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.

Example:

Your function can be declared in an external file as follows:

The onsubmit event would only contain the name of the function name:

Labels
  • No labels