NAME

ZForm - Perl extension for HTML form handling


SYNOPSIS

  use ZForm;


DESCRIPTION

Base class used to define a ZForm object. One should derive their own class from ZForm and override the setup method and possibly override the setup method

METHODS

new()
  Constructor. Takes a hash as an argument:
  cgi            The CGI.pm object associated with this
                 form. This is a required field.
  path           Path to HTML::Template files. Optional.
  error_handler  Reference to an ZForm::ErrorMessages
                 object that contains custom error
                 messages. Optional.
  fragment       1 means that this form is a fragment.
                 0 means that it is not. This is used
                 internally and need not be defined.
  dbh            database handle for constructing popup
                 menus from an SQL query.
setup()
  Sets up the form. This method should be overriden in the
  child class.
display()
  Displays the form
display_data_only()
  Displays the form with data only.
display_template()
  Displays the form with a template. This function is deprecated.
  I don't know why it is still in here, but I haven't had a chance
  look for any references to it in my tests.
validate()
  Validates the form. This method can be overridden for more
  validation goodness. Returns 1 on success, 0 on failure
error_handler($error_handler)
  Accessor / Mutator for the error handler. Takes a reference to
  a ZForm::ErrorMessages object. Returns the the error handler
  for this ZForm
cgi()
  Accessor / Mutator for the CGI.pm object
data_only()
  Accessor / Mutator for display data only flag. If 
  set to 1, no HTML input fields will be displayed,
  only data will be displayed. If set to 0, HTML input
  fields will be displayed.
dbh()
  Accessor / Mutator for the database handle
errors()
  Accessor / Mutator for form error hash
form_def()
  Accessor / Mutator for the form definition
fragment()
  Accessor / Mutator for setting form fragment status
param()
  Mutator for extra template parameters. Takes a hash where
  the keys are template parameter names.
prefix()
  Accessor / Mutator for field name prefix. Used internally
  for form fragments. Prepends a name to each form field name
template()
  Accessor / Mutator for the template file name.
tmpl_path()
  Accessor / Mutator for the template path.
values()

  Accessor / Mutator for form values. Use this method
  to define default form values and to retrieve values
  from the form. Values are supplied and returned as a
  reference to a hash. The  keys are the names of the
  fields.

EXPORT

None by default.


SEE ALSO

CGI

HTML::Template

CGI::Application

ZForm::ErrorMessages

ZForm::FieldValidator

http://zform.sourceforge.net


AUTHOR

Jeff Bowles, <jbowles@zianet.com>


COPYRIGHT AND LICENSE

Copyright 2003 by ZiaNet

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.