Set the field in error
Member of Field (PRIM_MD.Input)
Name | Type | Data Type | Description |
---|---|---|---|
ErrorText | *Input (Optional) | Unicode String | Text to be displayed |
The ShowError method is used to highlight the field as being in error. The text specified in the ErrorText parameter will be displayed in the Helper area of the control. The reciprocal ClearError method is used to remove the error state. The HasError property can be used to test whether a field is currently in error.
In this example, a UserID and Password are tested when they change.
Begin_Com Role(*EXTENDS #PRIM_WEB) Height(672) Width(1017) Define_Com Class(#PRIM_MD.Edit) Name(#UserID) DisplayPosition(1) Label('UserID') Left(24) Parent(#COM_OWNER) TabPosition(1) Top(24) Height(68) Width(377) HelperText('Enter a ') Define_Com Class(#PRIM_MD.Edit) Name(#Password) DisplayPosition(2) Label('Password') Left(24) Parent(#COM_OWNER) TabPosition(2) Top(104) Height(68) Width(377) Evtroutine Handling(#UserID.Changed) If (#UserID.Value.CurChars < 6) #UserID.ShowError( 'User ID must be at least 6 characters' ) Else #UserID.ClearError Endif Endroutine Evtroutine Handling(#Password.Changed) If (#Password.Value.IsValidPassword( Medium )) #Password.ClearError Else #Password.ShowError( 'Min 6 chars, one upper|lower|number' ) Endif Endroutine End_Com
Febuary 18 V14SP2