jFormer DocumentationBasic Fields

Text Area

JFormComponentTextArea(String id, String label[, Array optionArray])

The Text Area field is a multi-line input field that accepts text. This form field is best used for long answer, free form questions such as, "Can you describe the animal that attacked you?"

Usage

Constructor

    new JFormComponentTextArea(String id, String label[, Array optionArray])

Sample Usage

Create a simple textarea component with a tooltip:

    $textArea = new JFormComponentTextArea('id', 'Label:', array(
        'tip' => '

This is a tooltip on a Textarea component.

', ));

Value Returned

String

CSS Class

.jFormComponentTextArea

Text Area Options

These options are specific to the JFormComponentTextArea object.

disabled

false

determines | determines whether or not the input field is disabled. A disabled input element is unusable and un-clickable.

emptyValue

null

string | Receives a string which will be displayed in the input field until the user focus on it. If the user leaves the field empty and tabs away, the empty value will display again. Empty values are not passed to the server for processing.

readOnly

false

string | Receives a boolean, either true or false, which determines whether or not the input field is read only. A read only input element cannot be modified. However, a user can tab to it, highlight it, and copy the text from it.

wrap

off

string | Receives a string, either 'hard' or 'off', if set to hard, enables the wrap property on the text area.

allowTabbing

false

boolean | if set to true, tabbing while within the textarea will indent rather than tab to the next form component.

autogrow

false

boolean | if set to true, the textarea will become larger as more and more lines are added to it.

width

null

string | Receives a string, like '20px' or '6em', which is set as the CSS width value on the input element. Alternatively, you may pass any of the following strings and they will translate to CSS em values.

  • 'shortest' - 2em
  • 'short' - 6em
  • 'mediumShort' - 9em
  • 'medium' - 12em
  • 'mediumLong' - 15em
  • 'long' - 18em
  • 'longest' - 24em

height

null

string | Receives a string, like '20px' or '6em', which is set as the CSS width value on the input element. Alternatively, you may pass any of the following strings and they will translate to CSS em values.

  • 'short' - 6em
  • 'medium' - 12em
  • 'tall' - 18em

Component Options

These options are common to all components.

null

description

HTML | a description for the component, shows underneath the component inside a DIV with the class jFormComponenpescription.

null

instanceOptions

Array, [max(int), addButtonText(string), removeButtonText(text)] | see instanceOptions page for more information.

null

dependencyOptions

Array, [dependentOn(string), display(string), jsFunction(Javascript)[, animationOptions(array)]] | see dependencyOptions page for more information.

null

triggerFunction

Javascript | a javascript function that runs upon component change.

null

tip

HTML | a tooltip that displays whenever the component has focus. Gives any extra help or explanation a form user might need.

null

validationOptions

Array | an of validations specific to the component, see the specific component for its validations.

false

showErrorTipOnce

Boolean | this option makes the error tip only show up on the first focus on the component if it does not pass validation.

false

enterSubmits

Boolean | if true pressing enter while this component has focus submits the form, or advances to the next page.

null

style

CSS | set the style attribute for the component wrapper div.

null

initialValue

String | preset the value of the component upon form loading.

Text Area Validation Options

NameError Message and Description
required

"Required."

Makes the component required, the entered value may not be white space or empty.

Next Section: Advanced Fields

This page was last edited on April 25, 2011 at 10:57am.

4 comments (add a comment)

Marie on 2011-06-02 05:49:37

Is it possible to have a MaxLenght as Validation Options for Textarea fields?

Edward Meshuris on 2012-02-03 19:12:06

Min length would be great....

tt on 2012-02-21 06:57:54

ip[;[;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\





































































































































































































































































cool