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

Class INPUT

source code

  object --+        
           |        
XmlComponent --+    
               |    
             DIV --+
                   |
                  INPUT
Known Subclasses:
SELECT, TEXTAREA


INPUT Component

examples::

    >>> INPUT(_type='text', _name='name', value='Max').xml()
    '<input name="name" type="text" value="Max" />'

    >>> INPUT(_type='checkbox', _name='checkbox', value='on').xml()
    '<input checked="checked" name="checkbox" type="checkbox" value="on" />'

    >>> INPUT(_type='radio', _name='radio', _value='yes', value='yes').xml()
    '<input checked="checked" name="radio" type="radio" value="yes" />'

    >>> INPUT(_type='radio', _name='radio', _value='no', value='yes').xml()
    '<input name="radio" type="radio" value="no" />'

the input helper takes two special attributes value= and requires=.

:param value: used to pass the initial value for the input field.
    value differs from _value because it works for checkboxes, radio,
    textarea and select/option too.

    - for a checkbox value should be '' or 'on'.
    - for a radio or select/option value should be the _value
        of the checked/selected item.

:param requires: should be None, or a validator or a list of validators
    for the value of the field.



Instance Methods [hide private]
 
_validate(self)
nothing to validate yet.
source code
 
_postprocessing(self)
Handling of attributes (normally the ones not prefixed with '_').
source code
 
xml(self)
generates the xml for this component.
source code

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

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

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

Class Variables [hide private]
  tag = 'input/'

Inherited from DIV: regex_attr, regex_class, regex_id, regex_tag

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

_validate(self)

source code 
nothing to validate yet. May be overridden by subclasses
Overrides: DIV._validate
(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: DIV.xml
(inherited documentation)