Package web2py :: Package gluon :: Module html :: Class FORM
[hide private]
[frames] | no frames]

Class FORM

source code

  object --+        
           |        
XmlComponent --+    
               |    
             DIV --+
                   |
                  FORM
Known Subclasses:

example:

   >>> form=FORM(INPUT(_name="test", requires=IS_NOT_EMPTY()))
   >>> form.xml()
   '<form action="" enctype="multipart/form-data" method="post"><input name="test" type="text" /></form>'

a FORM is container for INPUT, TEXTAREA, SELECT and other helpers

form has one important method:

   form.accepts(request.vars, session)

if form is accepted (and all validators pass) form.vars contains the accepted vars, otherwise form.errors contains the errors. in case of errors the form is modified to present the errors to the user.

Instance Methods [hide private]
 
__init__(self, *components, **attributes)
:param *components: any components that should be nested in this element :param **attributes: any attributes you want to give to this element
source code
 
_postprocessing(self)
Handling of attributes (normally the ones not prefixed with '_').
source code
 
accepts(self, vars, session=None, formname='default', keepvalues=False, onvalidation=None) source code
 
hidden_fields(self) source code
 
xml(self)
generates the xml for this component.
source code

Inherited from DIV: __delitem__, __getitem__, __len__, __nonzero__, __setitem__, __str__, append, element, elements, insert, update

Inherited from DIV (private): _fixup, _traverse, _validate, _wrap_components, _xml

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__

Class Variables [hide private]
  tag = 'form'
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, *components, **attributes)
(Constructor)

source code 

:param *components: any components that should be nested in this element :param **attributes: any attributes you want to give to this element

:raises SyntaxError: when a stand alone tag receives components

Overrides: object.__init__
(inherited documentation)

_postprocessing(self)

source code 

Handling of attributes (normally the ones not prefixed with '_').

Nothing to postprocess yet. May be overridden by subclasses

Overrides: DIV._postprocessing
(inherited documentation)

xml(self)

source code 

generates the xml for this component.

Overrides: XmlComponent.xml