PAJES 3.0.21

org.pajes.html.validation
Class IsEqual

java.lang.Object
  extended by org.pajes.html.validation.ValidationFunction
      extended by org.pajes.html.validation.IsEqual
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class IsEqual
extends ValidationFunction

Creates a JavaScript validation function to validate that the user entered the same value twice.

See Also:
Serialized Form

Constructor Summary
IsEqual()
          Creates a JavaScript validation function.
IsEqual(InputField element, java.lang.String displayName, InputField comparisonElement)
          Creates a JavaScript validation function.
IsEqual(InputField element, java.lang.String displayName, InputHidden comparisonElement)
          Creates a JavaScript validation function.
 
Method Summary
 void setComparisonField(Input comparisonField)
          Sets the comparisonField.
 void setComparisonField(java.lang.String comparisonField)
          Sets the comparisonField.
 java.lang.String toJavaScript(Browser browser)
          Converts the validation function into a string to be returned to the browser.
 
Methods inherited from class org.pajes.html.validation.ValidationFunction
clone, getDisplayName, getInputField, isMandatory, setDisplayName, setInputField, setMandatory, setMandatory, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IsEqual

public IsEqual()
Creates a JavaScript validation function.


IsEqual

public IsEqual(InputField element,
               java.lang.String displayName,
               InputField comparisonElement)
Creates a JavaScript validation function.

Parameters:
element - the input field to be validated.
displayName - the name of the field that will appear in any error messages.
comparisonElement - the input field to which the element must be equal.

IsEqual

public IsEqual(InputField element,
               java.lang.String displayName,
               InputHidden comparisonElement)
Creates a JavaScript validation function.

Parameters:
element - the input field to be validated.
displayName - the name of the field that will appear in any error messages.
comparisonElement - the field to which the element must be equal.
Method Detail

setComparisonField

public void setComparisonField(Input comparisonField)
Sets the comparisonField.

Parameters:
comparisonElement - the field to which the element must be equal.

setComparisonField

public void setComparisonField(java.lang.String comparisonField)
Sets the comparisonField.

Parameters:
domReference - the JavaScript DOM reference of the field to which the element must be equal.

toJavaScript

public java.lang.String toJavaScript(Browser browser)
Converts the validation function into a string to be returned to the browser.

Specified by:
toJavaScript in class ValidationFunction
Parameters:
browser - the browser to which the function will be returned.
Returns:
the string consisting of the JavaScript function that will be sent to the browser to validate the input field.

PAJES 3.0.21

Copyright 1998-2007 Viridian Pty Limited. All Rights Reserved.