fc.web.forms
Class VSameText

java.lang.Object
  extended by fc.web.forms.FormValidator
      extended by fc.web.forms.VSameText

public final class VSameText
extends FormValidator

Validates two text input boxes to see if they are the same. (this could be a text box for say email and a second text box to confirm the email).

Note, other rules such as required length, characters etc., are not checked by this validator. Add a VText to each password field for that purupose.


Constructor Summary
VSameText(Form f, String name, String errorMessage, Text field_one, Text field_two)
           
 
Method Summary
 boolean validate(FormData fd, javax.servlet.http.HttpServletRequest req)
          Validates multiple fields together.
 
Methods inherited from class fc.web.forms.FormValidator
getErrorMessage, getName, setErrorMessage, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VSameText

public VSameText(Form f,
                 String name,
                 String errorMessage,
                 Text field_one,
                 Text field_two)
Parameters:
field_one - the first text box
field_two - the second text box
Method Detail

validate

public boolean validate(FormData fd,
                        javax.servlet.http.HttpServletRequest req)
Description copied from class: FormValidator
Validates multiple fields together. Note, implementations need not call the validator for each field if that field also has a field level validator (since each field is individually validated by the form). Implementations should validate multiple fields to see if they make sense when analysed as a whole.

Important notes: Typically, validation should be skipped in the following circumstances: