[ Index ]
 

Code source de phpMyVisites 2.3

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/libs/Html/QuickForm/ -> advcheckbox.php (sommaire)

(pas de description)

Poids: 283 lignes (9 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

HTML_QuickForm_advcheckbox:: (10 méthodes):
  HTML_QuickForm_advcheckbox()
  getPrivateName()
  getOnclickJs()
  setValues()
  setValue()
  getValue()
  toHtml()
  getFrozenHtml()
  onQuickFormEvent()
  exportValue()


Classe: HTML_QuickForm_advcheckbox  - X-Ref

HTML class for an advanced checkbox type field

Basically this fixes a problem that HTML has had
where checkboxes can only pass a single value (the
value of the checkbox when checked).  A value for when
the checkbox is not checked cannot be passed, and
furthermore the checkbox variable doesn't even exist if
the checkbox was submitted unchecked.

It works by creating a hidden field with the passed-in name
and creating the checkbox with no name, but with a javascript
onclick which sets the value of the hidden field.

HTML_QuickForm_advcheckbox($elementName=null, $elementLabel=null, $text=null, $attributes=null, $values=null)   X-Ref
Class constructor

param: string    $elementName    (optional)Input field name attribute
param: string    $elementLabel   (optional)Input field label
param: string    $text           (optional)Text to put after the checkbox
param: mixed     $attributes     (optional)Either a typical HTML attribute string
param: mixed     $values         (optional)Values to pass if checked or not checked
return: void

getPrivateName($elementName)   X-Ref
Gets the pribate name for the element

param: string  $elementName The element name to make private
return: string

getOnclickJs($elementName)   X-Ref
Create the javascript for the onclick event which will
set the value of the hidden field

param: string    $elementName    The element name
return: string

setValues($values)   X-Ref
Sets the values used by the hidden element

param: mixed   $values The values, either a string or an array
return: void

setValue($value)   X-Ref
Sets the element's value

param: mixed   Element's value

getValue()   X-Ref
Returns the element's value

return: mixed

toHtml()   X-Ref
Returns the checkbox element in HTML
and the additional hidden element in HTML

return: string

getFrozenHtml()   X-Ref
Unlike checkbox, this has to append a hidden input in both
checked and non-checked states


onQuickFormEvent($event, $arg, &$caller)   X-Ref
Called by HTML_QuickForm whenever form event is made on this element

param: string    $event  Name of event
param: mixed     $arg    event arguments
param: object    $caller calling object
return: void

exportValue(&$submitValues, $assoc)   X-Ref
This element has a value even if it is not checked, thus we override
checkbox's behaviour here




Généré le : Mon Nov 26 14:10:01 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics