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 checked type="checkbox" name="checkbox"/>'
>>> INPUT(_type='radio',_name='radio',_value='yes',value='yes').xml()
'<input checked value="yes" type="radio" 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]
 
postprocessing(self) source code
 
rec_accepts(self, vars) source code
 
xml(self) source code

Inherited from DIV: __init__, __str__, accepts, rec_clear

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]

postprocessing(self)

source code 
Overrides: DIV.postprocessing

rec_accepts(self, vars)

source code 
Overrides: DIV.rec_accepts

xml(self)

source code 
Overrides: DIV.xml