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

Class INPUT

source code

object --+    
         |    
       DIV --+
             |
            INPUT
Known Subclasses:

examples:

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

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

value is 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.

requres should be None, or a validator or a list of validators for the value of the field.

Instance Methods [hide private]
 
validate(self) source code
 
postprocessing(self) source code
 
xml(self) source code

Inherited from DIV: __delitem__, __getitem__, __init__, __len__, __setitem__, __str__, append, fixup, insert, traverse

Inherited from DIV (private): _xml

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

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

Inherited from object: __class__

Method Details [hide private]

validate(self)

source code 
Overrides: DIV.validate

postprocessing(self)

source code 
Overrides: DIV.postprocessing

xml(self)

source code 
Overrides: DIV.xml