PAJES 3.0.21

org.pajes.html.validation
Class IsValid

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

public class IsValid
extends ValidationFunction

Creates a JavaScript validation function to validate that the user entered one of a set of specified values.

See Also:
Serialized Form

Constructor Summary
IsValid()
          Creates a JavaScript validation function.
IsValid(InputField element, java.lang.String displayName, boolean caseSensitive, boolean mandatory, java.lang.String[] validValues)
          Creates a JavaScript validation function.
 
Method Summary
 void setCaseSensitive(boolean caseSensitive)
          Sets the case sensitivity of the comparison.
 void setCaseSensitive(java.lang.String caseSensitive)
          Sets the case sensitivity of the comparison.
 void setValidValues(java.lang.String[] validValues)
          Sets the valid values.
 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

IsValid

public IsValid()
Creates a JavaScript validation function.


IsValid

public IsValid(InputField element,
               java.lang.String displayName,
               boolean caseSensitive,
               boolean mandatory,
               java.lang.String[] validValues)
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.
caseSensitive - true if the comparison to the valid values is to be case sensitive.
mandatory - true if a value is required, or false if it may be left blank.
validValues - the array of valid values.
Method Detail

setCaseSensitive

public void setCaseSensitive(boolean caseSensitive)
Sets the case sensitivity of the comparison.

Parameters:
caseSensitive - true if the comparison to the valid values is to be case sensitive.

setCaseSensitive

public void setCaseSensitive(java.lang.String caseSensitive)
Sets the case sensitivity of the comparison.

Parameters:
caseSensitive - "true" if the comparison to the valid values is to be case sensitive.

setValidValues

public void setValidValues(java.lang.String[] validValues)
Sets the valid values.

Parameters:
validValues - the array of valid values.

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.