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
006package fc.web.forms;
007
008import javax.servlet.*;
009import javax.servlet.http.*;
010import java.io.*;
011import java.util.*;
012import java.util.regex.*;
013
014import fc.jdbc.*;
015import fc.io.*;
016import fc.util.*;
017
018/**
019Validates that the field is filled out by the user.
020**/
021public final class VFilled extends FieldValidator
022{
023boolean   isFilled = false;  
024
025/** 
026Creates a new validator that fails validation if the fields
027is not filled out by the user.
028**/
029public VFilled(Field field, String errorMessage)
030  {
031  super(field, errorMessage);
032  }
033
034/** 
035Validates a field's value to be isFilled.
036**/
037public boolean validate(FormData fd, HttpServletRequest req) 
038  {
039  boolean val = field.isFilled(fd);
040  return val;
041  } 
042
043}