The pui.inputfilter function, if defined, fires for each field that is modified on a Genie/5250 or Rich Display File screen. The function has the opportunity to modify the original user input before it is submitted to the server. This can be useful for filtering out undesirable characters, such as when the user copies/pastes data into the screen from another application.
The pui.inputfilter function receives the following parameters:
value - a string containing the original user input value.
context - a string set to either "genie" for Genie/5250 screen, or "dspf" for Rich Display File screen.
If the pui.inputfilter function returns a string, the return value will be used in place of the original value. Any other type of return value (or if no value is returned) will result in the original field value being used.
If an unhandled exception occurs in the function, the original user input will be used and the exception will be logged to the browser's console.
The following code replaces tabs with a space, and "smart quotes" (such as copied/pasted from MS Office apps) with the normal single/double quote character.