SPS Home    >   Dgreath    >   Business Rules    >   isComplexPwd()


isComplexPwd() Rule

The following snippet implements a business rule that returns true if a given form element value is a complex password formation and returns false if it is not. A complex password is defined as 15 characters in length with at least one digit, one capital letter, one lower case letter and one special symbol (!@#$%^&*). This method does not validate the existance or correctness of the submission. Specify the form's name in formName and the element's name in elementName. This is a codebehind method and requires nothing in the xhtml markup.

isComplexPwd()
 

  

Suggested Usage

The following snippet demonstrates suggested code for typical validation summary applications. The variable msg is a previously instantiated string that holds the accumulating list of validation errors to be displayed. This example assumes element "text1" of form "demo" is to be validated.
This is a codebehind method and requires nothing in the xhtml markup.

Summary Usage
 

  

The following snippet demonstrates suggested code for adjacent error message applications. This example assumes element "text1" of form "demo" is to be validated with the results posted to an ajacent span tag "error1". (example: <span id="error1"></span>). This validator will fire every time the watched control loses focus.
This is a codebehind method and requires nothing in the xhtml markup other than the target element.

Adjacent Usage
 

  

Test/Demonstration

Use the box below to demonstrate how the function behaves: