...
- value - a string containing the value being submitted to the serveroriginal user input value.
- fieldInfo - information about the field. The format of this parameter is different for Rich Display File screens vs. Genie/5250 screens, and is subject to addition of properties in the future. It's recommended to explore the parameter with a JavaScript debugger to see what the available properties are.
- 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.
Example:
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.
Code Block | ||||
---|---|---|---|---|
| ||||
pui.inputfilter = function(value, fieldInfo, context) {
return value.replace(/\t/g, " ").
replace(/\u201C/g, "\"").
replace(/\u201D/g, "\"").
replace(/\u2018/g, "'").
replace(/\u2019/g, "'");
}
|
...