Text field Field

Function : Displays a single line text field in the form

Parameters

Label The label of this element
CSS Class CSS class assigned to this element
Style using CSS only Defines whether or not JForms should append inline CSS attributes to the element, Set to “YES” if you want to disable inline CSS attributes
Required Whether or not this field is required , the Form will not be submitted until this field is filled
Maximum lengthMaximum number of characters allowed
User E-mail Whether or not to consider this field as the E-mail address of the user filling this form (Used by mail plugin) (This parameter is to be deprecated, use E-Mail element instead
Validation Validation rules to apply to this field, also see ”Adding a pre-defined validation rule
Other Validation Rule Regular expression used to validate input (Available only when Validation = “Other”)

Note:

  • Setting “User E-mail” to “Yes” doesn't automatically set validation to “E-mail”
  • Any HTML tags are stripped from input

Example

Example 1

Sending the user a confirmatory “thank you” message

Prerequisites

  • Make sure you have the Mail Plugin enabled for this form
  • Make sure you have enabled the “Send User a confirmation message” setting from “Mail plugin slider tab under “Forms” tab)

Procedure

  • Create your form normally
  • Place a text field and set “Is User E-mail” to “Yes”
  • Modify the “User Confirmation Message” field to format the E-mail message you're sending to the user, You can use Mail Placeholders

Notes:

  • This function is about to be deprecated, use E-Mail element instead
  • The user E-mail will be used as “Reply-to” for E-mails sent to administrators
Example 2

To create a required text field that allows a maximum length of 15 characters and uses a custom validation rule

  • Set “Required” : Yes
  • Set “Maximum length” : 15
  • Set “Validation” : Other
  • Set “Other Validation Rule” : “Your Regular Expression”
 
0.7/elements/textbox.txt · Last modified: 2009/09/06 20:57 by dr_drsh
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki