/functions/forms.php

Description

forms.php - html form functions

Functions to build HTML forms in a safe and consistent manner. All name, value attributes are htmlentitied.

Functions
addCheckBox (line 42)

Form checkbox

void addCheckBox ( $name, [ $checked = false], [ $value = null])
  • $name
  • $checked
  • $value
addForm (line 135)

Make a <form> start-tag.

void addForm ( $action, [ $method = 'post'], [ $name = ''], [ $enctype = ''], [ $charset = ''])
  • $action
  • $method
  • $name
  • $enctype
  • $charset
addHidden (line 58)

A hidden form field.

void addHidden ( $name,  $value)
  • $name
  • $value
addInput (line 65)

An input textbox.

void addInput ( $name, [ $value = ''], [ $size = 0], [ $maxlength = 0])
  • $name
  • $value
  • $size
  • $maxlength
addInputField (line 24)

Helper function to create form fields, not to be called directly, only by other functions below.

void addInputField ( $type, [ $name = null], [ $value = null], [ $attributes = ''])
  • $type
  • $name
  • $value
  • $attributes
addPwField (line 34)

Password input field

void addPwField ( $name, [ $value = null])
  • $name
  • $value
addRadioBox (line 50)

Form radio box

void addRadioBox ( $name, [ $checked = false], [ $value = null])
  • $name
  • $checked
  • $value
addReset (line 119)

Form reset button, $value = caption

void addReset ( $value)
  • $value
addSelect (line 87)

Function to create a selectlist from an array.

Usage: name: html name attribute values: array ( key => value ) -> <option value="key">value</option> default: the key that will be selected usekeys: use the keys of the array as option value or not

void addSelect ( $name,  $values, [ $default = null], [ $usekeys = false])
  • $name
  • $values
  • $default
  • $usekeys
addSubmit (line 113)

Form submission button

Note the switched value/name parameters!

void addSubmit ( $value, [ $name = null])
  • $value
  • $name
addTextArea (line 126)

Textarea form element.

void addTextArea ( $name, [ $text = ''], [ $cols = 40], [ $rows = 10], [ $attr = ''])
  • $name
  • $text
  • $cols
  • $rows
  • $attr

Documentation generated on Sat, 07 Oct 2006 16:31:20 +0300 by phpDocumentor 1.3.0RC6