restrict-characters
Reactive icon

Restrict Characters

Stable version 2.0.1 (Compatible with OutSystems 11)
Uploaded
 on 30 June 2024
 by 
5.0
 (2 ratings)
restrict-characters

Restrict Characters

Details
A client action to restrict characters with Regular Expression (RegEx) that allows users to set specific constraints on the characters that can be entered in a certain field, and it works for both web and mobile applications (input has to be of text type). It uses pattern-matching syntax to validate the input and ensure that it meets the specified criteria. For example, if the user wants to restrict a field to only accept alphanumeric characters, they can set a RegEx pattern to match only letters and numbers. This feature can be used to enforce data quality and consistency, ensuring that the entered data meets the required format and is free of unwanted characters. By implementing this client action, developers can improve the user experience and prevent errors in data input for both web and mobile platforms.
Read more

A client action to restrict characters with Regular Expression (RegEx) that allows users to set specific constraints on the characters that can be entered in a certain field, and it works for both web and mobile applications (input has to be of text type). It uses pattern-matching syntax to validate the input and ensure that it meets the specified criteria. For example, if the user wants to restrict a field to only accept alphanumeric characters, they can set a RegEx pattern to match only letters and numbers. This feature can be used to enforce data quality and consistency, ensuring that the entered data meets the required format and is free of unwanted characters. By implementing this client action, developers can improve the user experience and prevent errors in data input for both web and mobile platforms.

Steps to use the client action:

1. Create a handler for the On Change event of the input field (input has to be of text type).

2. Call the client action and pass the input widget Id, the desired regular expression pattern for allowed characters and boolean values to convert to upper or lower case as parameters.

3. Assign the output of the action to the same variable bound to the input field.

Note: If you are going to use ConvertToUpper or ConvertToLower, please use both upper and lower case charater set, for example 'a-zA-Z', otherwise the converted values might be removed based on allowed pattern.

Note: If both ConvertToUpper and ConvertToLower are set to True then ConvertToUpper will be used.

Note: It is recommended to clearly define the desired regular expression pattern for allowed characters to ensure the correct behavior of the client action. Use a website such as https://regex101.com/ to generate the pattern.

Note: Change the data type of the output in the 3rd step using Outsystems built-in actions as required to match the data type of the variable bound to the input field.




Release notes (2.0.1)

New Features:

  • Character Restriction Enhancement: Resolved issue where the cursor would jump to the end of the input field when the value was modified due to restricted characters or case conversion.
  • Case Conversion Functionality: Added option to convert input values to upper or lower case as needed.

Deprecated:

  • Deprecated previous action by renaming it to avoid dependency errors for users who do not update or manually change the component.

Bug Fixes:

  • Fixed cursor positioning issue during value modification due to restricted characters or case conversion.

Improvements:

  • Enhanced overall stability and performance of the component.

Documentation:

  • Updated documentation to include new features and usage instructions.

Notes:

  • Users are encouraged to update to this version to benefit from improved user experience and functionality enhancements.
  • If you are going to use ConvertToUpper or ConvertToLower, please use both upper and lower case character sets, for example 'a-zA-Z'. Otherwise, the converted values might be removed based on allowed patterns.
  • If both ConvertToUpper and ConvertToLower are set to True, then ConvertToUpper will be used.
License (2.0.1)
Reviews (2)
by 
2023-02-14
in version 1.0.0
Outsystems should implement it directly
by 
2023-02-13
in version 1.0.0
Very useful component.
Team
Other assets in this category