SPS Home    >   Dgreath    >   Business Rules    >   isIdentical()


isIdentical() Rule

The following snippet implements a business rule that returns true if the values in two specified form elementes are the same and returns false if they are not. Specify the form's name in formName and the two elements' names in elementName1 and elementName2.
This rule is good for validating new passwords, for example.
This is a codebehind method and doesn't require anything in the xhtml markup.

isIdentical()
 

  

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 elements "text1" and "text2" of form "demo" are 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