Issue

When setting a validation on controls on a SmartForm, it will fail with a red border and error:

Image

However, if the borderless setting is set to TRUE on the controls Properties, it will not show a red border or error message on validation.

Symptoms

This is a known issue on K2 4.7 and K2 Five.

Resolution

There are 3 workarounds to consider:

Workaround #1:

On the validation dialog box, there is an option called “Show validation message in a popup dialog” – this will show a warning message if the validation is not met.

More information can be found here: http://help.k2.com/onlinehelp/k2cloud/userguide/update_3/default.htm#create/k2designer/controls/controlvalidation.htm

Workaround #2:

  • On the Form/View add an additional datalabel called: lblError.
  • Set the label to invisible and the text color to Red.
  • On the Form/View rules, on the validation add an "Else" condition, to show the label with an error message (e.g. "A value is required").
    Image
  • Runtime:
    Image

Workaround #3:

Similar to Workaround #2

  • With the control set to Borderless, set the border color to Red.
  • On the Form/View rules, on the validation add an "Else" condition to show the border.
    Image
  • Runtime:
    Image
This can be combined with Workaround #2 to show the border and validation error message.