/tag_utils/form_utils.inc

Description

This file contains various helper functions for building forms and form elements.

$Id: _2_X_tag_utils_form_utils_inc.html,v 1.1.2.2 2005/09/02 00:07:37 hemna Exp $

Functions
form_active_checkbox (line 316)

build/render an input tag of type CHECKBOX with onClick javaScript selection

  • return: a container object
  • author: Suren Markossian
object returns form_active_checkbox (string $name, [string $text = NULL], [string $value = NULL], [string $class = NULL], [mixed $onClick = NULL], [mixed $disabled = FALSE])
  • string $name: - the name of the input tag.
  • string $value: - the value of the tag
  • string $text: - text label for the checkbox
  • string $class: class - CSS class of the text
form_active_radio (line 228)

build/render an set of radio buttons with onClick javaScript selection

  • return: a container object
  • author: Suren Markossian
object returns form_active_radio (string $name, array $list, string $value, [bool $line_break = TRUE], [array $attribs = FALSE])
  • string $name: - the name of the input tag.
  • array $list: - an array of text label = value pairs
  • string $value: - the default value (the one that will be checked)
  • bool $line_break: - specify whether to put a line break after each radio button
  • array $attribs: - specify addionnal attribs for each value
form_button (line 141)

build/render an input tag of type button

  • return: either returns an input object (default) or raw html.
mixed form_button (string $name, [string $value = NULL], [array $attributes = array()], [boolean $render_flag = FALSE])
  • string $name: - the name of the input tag.
  • string $value: - the value of the tag
  • array $attributes: - any extra name='value' pair attributes
  • boolean $render_flag: - render an object (FALSE) or raw html (TRUE);
form_checkbox (line 294)

build/render an input tag of type CHECKBOX

  • return: either returns an input object (default) or raw html.
mixed form_checkbox (string $name, [string $value = NULL], [array $attributes = array()], [boolean $render_flag = FALSE])
  • string $name: - the name of the input tag.
  • string $value: - the value of the tag
  • array $attributes: - any extra name='value' pair attributes
  • boolean $render_flag: - render an object (FALSE) or raw html (TRUE);
form_close (line 60)

render a form close tag

  • return: - the </form> tag.
string form_close ([mixed $indent_level = 0])
form_file (line 375)

build/render an html tag of file

  • return: either returns an input object (default) or raw html.
mixed form_file (string $name, [string $value = NULL], [array $attributes = array()], [boolean $render_flag = FALSE])
  • string $name: - the name of the input tag.
  • string $value: - the value of the tag
  • array $attributes: - any extra name='value' pair attributes
  • boolean $render_flag: - render an object (FALSE) or raw html (TRUE);
form_hidden (line 274)

build/render an input tag of type hidden

  • return: either returns an input object (default) or raw html.
mixed form_hidden (string $name, [string $value = NULL], [array $attributes = array()], [boolean $render_flag = FALSE])
  • string $name: - the name of the input tag.
  • string $value: - the value of the tag
  • array $attributes: - any extra name='value' pair attributes
  • boolean $render_flag: - render an object (FALSE) or raw html (TRUE);
form_image (line 183)

build/render an input tag of type image

  • return: either returns an input object (default) or raw html.
mixed form_image (string $name, [string $value = NULL], string $src, [array $attributes = array()], [boolean $render_flag = FALSE])
  • string $name: - the name of the input tag.
  • string $value: - the value of the tag
  • string $src: - the image src
  • array $attributes: - any extra name='value' pair attributes
  • boolean $render_flag: - render an object (FALSE) or raw html (TRUE);
form_open (line 49)

render an form open tag only.

This is usefull for forms that are inside a table. you would render the form tag first, then the table with the form fields.

  • return: returns the raw form tag.
string form_open (string $name, string $action, [string $method = "GET"], [string $attributes = array()], [mixed $indent_level = 0])
  • string $name: - name attribute of the form tag.
  • string $action: - the form action.
  • string $method: - form method
  • string $attributes: - any extra name='value' attributes for the form tag.
form_password (line 112)

build/render an input tag of type password

  • return: either returns an input object (default) or raw html.
mixed form_password (string $name, [string $value = NULL], [int $size = NULL], [int $maxlength = NULL], [array $attributes = array()], [boolean $render_flag = FALSE])
  • string $name: - the name of the input tag.
  • string $value: - the value of the tag
  • int $size: - the size in characters of the text tag
  • int $maxlength: - the maximum @ of characters for the field
  • array $attributes: - any extra name='value' pair attributes
  • boolean $render_flag: - render an object (FALSE) or raw html (TRUE);
form_radio (line 205)

build/render an input tag of type radio

  • return: either returns an input object (default) or raw html.
mixed form_radio (string $name, [string $value = NULL], [array $attributes = array()], [boolean $render_flag = FALSE])
  • string $name: - the name of the input tag.
  • string $value: - the value of the tag
  • array $attributes: - any extra name='value' pair attributes
  • boolean $render_flag: - render an object (FALSE) or raw html (TRUE);
form_select (line 445)

Build a select tag with all of its option tags

  • return: SELECTtag object.
  • author: Walt A. Boring IV
a form_select (string $name, [array $options = array()], [mixed $selected = ""], [boolean $multiple_flag = FALSE], [array $attribs = false])
  • string $name: - name of the select.
  • array $options:

    - an array of name value pairs for the options. the format is array( "LABEL" => VALUE ); each <option value="VALUE"> LABEL </option> ie array( "test" => "foo") would give an option of <option value="foo"> test </option>

    NOTE: this also supports automatic building of the optgroup. Just pass in an array of array("foogroup" => array("name" => "value1", "name2" => "value2"), "bargroup" => array("blah" => "foo"));

  • mixed $selected: - This can be either a string or an array. If its a string then, it will be the selected option value <option value="foo" SELECTED>foo</option> If it is an array, then all of the option values will be marked as SELECTED. This only makes sense to do if the multiple_flag is true.
  • boolean $multiple_flag: - is this a multiple selection select box?
  • array $attribs: - additionnal attributes to the select tag
form_select_is_selected (line 485)

This function is used by form_select to determin if a value is selected or not.

voolean form_select_is_selected (string $value, string $selected)
  • string $value: value
  • string $selected: selected value
form_submit (line 162)

build/render an input tag of type submit

  • return: either returns an input object (default) or raw html.
mixed form_submit (string $name, [string $value = NULL], [array $attributes = array()], [boolean $render_flag = FALSE])
  • string $name: - the name of the input tag.
  • string $value: - the value of the tag
  • array $attributes: - any extra name='value' pair attributes
  • boolean $render_flag: - render an object (FALSE) or raw html (TRUE);
form_text (line 80)

build/render an input tag of type text

  • return: either returns an input object (default) or raw html.
mixed form_text (string $name, [string $value = NULL], [int $size = NULL], [int $maxlength = NULL], [array $attributes = array()], [boolean $render_flag = FALSE])
  • string $name: - the name of the input tag.
  • string $value: - the value of the tag
  • int $size: - the size in characters of the text tag
  • int $maxlength: - the maximum @ of characters for the field
  • array $attributes: - any extra name='value' pair attributes
  • boolean $render_flag: - render an object (FALSE) or raw html (TRUE);
form_textarea (line 401)

build a textarea tag with name and attributes.

  • return: object.
  • author: Walt A. Boring
TEXTAREAtag form_textarea (string $name, [string $value = NULL], [array $attributes = array()], [boolean $render_flag = FALSE])
  • string $name: - the name of the textarea tag.
  • string $value: - data to display in the textarea.
  • array $attributes: - any extra name='value' pair attributes
  • boolean $render_flag: - render an object (FALSE) or raw html (TRUE);
html_form (line 28)

render an form open tag only.

This is usefull for forms that are inside a table. you would render the form tag first, then the table with the form fields.

  • return: returns the raw form tag.
string html_form (string $name, string $action, [string $method = "GET"], [string $attributes = array()])
  • string $name: - name attribute of the form tag.
  • string $action: - the form action.
  • string $method: - form method
  • string $attributes: - any extra name='value' attributes for the form tag.

Documentation generated on Thu, 1 Sep 2005 17:06:02 -0700 by phpDocumentor 1.3.0RC3