Package: Controls

Class: Zebra_Form_Hidden

source file: /includes/Hidden.php

Class Overview

XSS_Clean
|
--Zebra_Form_Control
|
--Zebra_Form_Hidden

Class for hidden controls.

Author(s):

Copyright:

  • (c) 2006 - 2016 Stefan Gabos

Methods

Inherited methods

Class: Zebra_Form_Control

Zebra_Form_Control::change_case()
Call this method to instruct the script to force all letters typed by the user, to either uppercase or lowercase, in real-time.
Zebra_Form_Control::disable_spam_filter()
Disables the SPAM filter for the control.
Zebra_Form_Control::disable_xss_filters()
Disables XSS filtering of the control's submitted value.
Zebra_Form_Control::get_attributes()
Returns the values of requested attributes.
Zebra_Form_Control::lock()
Locks the control's value. A locked control will preserve its default value after the form is submitted even if the user altered it.
Zebra_Form_Control::reset()
Resets the control's submitted value (empties text fields, unchecks radio buttons/checkboxes, etc).
Zebra_Form_Control::set_attributes()
Sets one or more of the control's attributes.
Zebra_Form_Control::set_rule()
Sets a single or an array of validation rules for the control.
Zebra_Form_Control::_render_attributes()
Converts the array with control's attributes to valid HTML markup interpreted by the toHTML() method

Class: XSS_Clean

XSS_Clean::sanitize()
Sanitizes submitted data so that Cross Site Scripting Hacks can be prevented.

Class methods

constructor __construct()

void __construct ( string $id , [ string $default = ''] )

Adds an <input type="hidden"> control to the form.

Do not instantiate this class directly! Use the add() method instead!

  1. // create a new form
  2. $form new Zebra_Form('my_form');
  3.  
  4. // add a hidden control to the form
  5. $obj $form->add('hidden''my_hidden''Secret value');
  6.  
  7. // don't forget to always call this method before rendering the form
  8. if ($form->validate()) {
  9.     // put code here
  10. }
  11.  
  12. // output the form using an automatically generated template
  13. $form->render();
Parameters:
string $id

Unique name to identify the control in the form.

The control's name attribute will be the same as the id attribute!

This is the name to be used when referring to the control's value in the POST/GET superglobals, after the form is submitted.

Hidden controls are automatically rendered when the render() method is called!
Do not print them in template files!

string $default (Optional) Default value of the text box.
Top

method toHTML()

string toHTML ( )

Generates the control's HTML code.

This method is automatically called by the render() method!

Tags:
return: The control's HTML code
Top