001 // Copyright (c) 2001 Hursh Jain (http://www.mollypages.org)
002 // The Molly framework is freely distributable under the terms of an
003 // MIT-style license. For details, see the molly pages web site at:
004 // http://www.mollypages.org/. Use, modify, have fun !
005
006 package fc.web.forms;
007
008 import javax.servlet.*;
009 import javax.servlet.http.*;
010 import java.io.*;
011 import java.util.*;
012 import java.util.regex.*;
013
014 import fc.jdbc.*;
015 import fc.io.*;
016 import fc.util.*;
017
018 /**
019 Validates that the field is filled out by the user.
020 **/
021 public final class VFilled extends FieldValidator
022 {
023 boolean isFilled = false;
024
025 /**
026 Creates a new validator that fails validation if the fields
027 is not filled out by the user.
028 **/
029 public VFilled(Field field, String errorMessage)
030 {
031 super(field, errorMessage);
032 }
033
034 /**
035 Validates a field's value to be isFilled.
036 **/
037 public boolean validate(FormData fd, HttpServletRequest req)
038 {
039 boolean val = field.isFilled(fd);
040 return val;
041 }
042
043 }