Validate Data K2 SmartForms
In K2 SmartForms you can easily validate any text input field by using standard regular expressions. When you select an input field you can assign a pattern to validate it under validation in the properties section.
K2 Automated Testing Software
BenchQA allows full test automation of K2, including fully automated K2 SmartForms and K2 Workflow testing. It promotes test driven development for K2 and ensures continued quality assurance for K2 solutions. Easily apply changes to test cases to accommodate changes to K2 apps and ensure all apps are regression tested to avoid defects and assure continuous quality.
K2 SmartForms comes with a set of standard validation patterns but you are able to add / edit your own custom patterns.
In this example we need users to be able to specify time in an hh:mm format, with 00:00 included. We simply add our regular expression in the pattern field and specify a validation error message to be displayed should the user not use the correct input format.
When the application is running fields that are valid display as normal.
Fields that are not using the correct input format will be highlighted in red and the validation message specified in the setup of the pattern will be displayed if the user hovers over the marked field.
It is important to note that all the patterns you create are global and can be used across all the views / forms in your application and not only within the specific view you created it in.