Control-level validation

Control-level validation messages are displayed next to a specific control.

Like page-level validation formulas, control-level validation formulas use the Hansen.Core.Result object. Use the properties of the result to specify the name of the control.

For example, this formula displays a message next to the Location Details field if the user enters fewer than 100 characters in that field:

Dim res as Hansen.Core.Result = Result.Success
if oBuildingApplication.ApplicationType.ApplicationType = "SFD" Then   
   if oBuildingApplication.Location.length < 100 Then
      Dim resLoc as Hansen.Core.Result = new Result(1, ResultSeverity.UserError, 
            "Location Description must be greater than 100 characters.")
      resLoc.properties.Add( "validationError", "locationDetails" )
      res += resLoc
   End If
End if
return res

To find the name of a control in Rhythm for Civics, right-click on the control and select Inspect. The name attribute specifies the name of the control.

Note: If the name of a control is entered incorrectly in a formula, the control-level validation message will be displayed as a page-level validation messages.