Skip to content
This repository
Browse code

Form field docs update (fixes #7521)

  • Loading branch information...
commit a9fa28172367a587c6b31cea1e80c648195d7b89 1 parent 56a3777
Ingo Schommer authored
120  docs/en/reference/form-field-types.md
Source Rendered
... ...
@@ -1,83 +1,75 @@
1 1
 # Form Field Types
2 2
 
3  
-This is a highlevel overview of available `[apiFormField]` subclasses. An automatically generated list is available through our [API](api:FormField)
  3
+This is a highlevel overview of available `[api:apiFormField]` subclasses. An automatically generated list is available through our [API]
4 4
 
5  
-## Formatted Input
  5
+## Basic
6 6
 
7  
-*  `[AjaxUniqueTextField](api:AjaxUniqueTextField)`: Text field that automatically checks that the value entered is unique for
8  
-the given set of fields in a given set of tables
9  
-*  `[AutocompleteTextField](api:AutocompleteTextField)`
10  
-*  `[ConfirmedPasswordField](api:ConfirmedPasswordField)`: Shows two password-fields, and checks for matching passwords.
11  
-*  `[CreditCardField](api:CreditCardField)`
12  
-*  `[CurrencyField](api:CurrencyField)`
13  
-*  `[EmailField](api:EmailField)`
14  
-*  `[HTMLEditorField](api:HTMLEditorField)`: A WYSIWYG editor field, powered by tinymce.
15  
-*  `[NumericField](api:NumericField)`: A Single Numeric field extending a typical TextField but with validation.
16  
-*  `[PasswordField](api:PasswordField)`
17  
-*  `[UniqueRestrictedTextField](api:UniqueRestrictedTextField)`: Text field that automatically checks that the value entered
18  
-is unique for the given set of fields in a given set of tables
19  
-*  `[UniqueTextField](api:UniqueTextField)`: Text field that automatically checks that the value entered is unique for the
20  
-given set of fields in a given set of tables
21  
-
22  
-## Date/Time
23  
-
24  
-*  `[DateField](api:DateField)`: Represents a date in a textfield (New Zealand)
25  
-*  `[DatetimeField](api:DatetimeField)`: Combined date- and time field
26  
-*  `[TimeField](api:TimeField)`: Represents time in a textfield (New Zealand)
  7
+ * `[api:CheckboxField]`: Single checkbox field.
  8
+ * `[api:DropdownField]`: A `<select>` tag. Can optionally save into has-one relationships.
  9
+ * `[api:ReadonlyField]`: Read-only field to display a non-editable value with a label.
  10
+ * `[api:TextareaField]`: Multi-line text field.
  11
+ * `[api:TextField]`: Multi-line text field.
  12
+ * `[api:PasswordField]`: Masked input field
27 13
 
28  
-## Structure
  14
+ ## Actions
29 15
 
30  
-*  `[CompositeField](api:CompositeField)`: Base class for all fields that contain other fields. Uses `<div>` in template, but
31  
-doesn't necessarily have any visible styling.
32  
-*  `[FieldGroup](api:FieldGroup)`: Same as CompositeField, but has default styling (indentation) attached in CMS-context.
33  
-*  `[api:FieldList]`: Basic container for sequential fields, or nested fields through CompositeField. Does NOT render a
34  
-`<fieldgroup>`.
35  
-*  `[TabSet](api:TabSet)`
36  
-*  `[Tab](api:Tab)`
  16
+ * `[api:FormAction]`: Button element for forms, both for `<input type="submit">` and `<button>`.
  17
+ * `[api:ResetFormAction]`: Action that clears all fields on a form.
  18
+
  19
+## Formatted Input
37 20
 
  21
+ * `[api:AjaxUniqueTextField]`: Text field that automatically checks that the value entered is unique for the given set of fields in a given set of tables
  22
+ 
  23
+ * `[api:ConfirmedPasswordField]`: Two masked input fields, checks for matching passwords.
  24
+ * `[api:CountryDropdownField]`: A simple extension to dropdown field, pre-configured to list countries.
  25
+ * `[api:CreditCardField]`: Allows input of credit card numbers via four separate form fields, including generic validation of its numeric values.
  26
+ * `[api:CurrencyField]`: Text field, validating its input as a currency. Limited to US-centric formats, including a hardcoded currency symbol and decimal separators. 
  27
+ See `[api:MoneyField]` for a more flexible implementation.
  28
+ * `[api:DateField]`: Represents a date in a single input field, or separated into day, month, and year. Can optionally use a calendar popup.
  29
+ * `[api:DatetimeField]`: Combined date- and time field
  30
+ * `[api:EmailField]`: Text input field with validation for correct email format according to RFC 2822.
  31
+ * `[api:GroupedDropdownField]`: Grouped dropdown, using <optgroup> tags.
  32
+ * `[api:HTMLEditorField].
  33
+ * `[api:MoneyField]`: A form field that can save into a `[api:Money]` database field.
  34
+ * `[api:NumericField]`: Text input field with validation for numeric values.
  35
+ * `[api:OptionsetField]`: Set of radio buttons designed to emulate a dropdown.
  36
+ * `[api:PhoneNumberField]`: Field for displaying phone numbers. It separates the number, the area code and optionally the country code and extension.
  37
+ * `[api:UniqueRestrictedTextField]`: Text field that automatically checks that the value entered is unique for the given set of fields in a given set of tables
  38
+ 
  39
+ * `[api:SelectionGroup]`: SelectionGroup represents a number of fields which are selectable by a radio button that appears at the beginning of each item.
  40
+ * `[api:TimeField]`: Input field with time-specific, localized validation.
38 41
 
39  
-## Actions
  42
+## Structure
40 43
 
41  
-*  `[api:Form]` for more info
42  
-*  `[InlineFormAction](api:InlineFormAction)`:  Render a button that will act as If you want to add custom behaviour, please
43  
-set {inlcudeDefaultJS} to false and work with behaviour.js.
44  
-*  `[api:Image]`: Action that uses an image instead of a button
45  
-*  `[InlineFormAction](api:InlineFormAction)`: Prevents placement of a button in the CMS-button-bar.
  44
+ * `[api:CompositeField]`: Base class for all fields that contain other fields. Uses `<div>` in template, but
  45
+doesn't necessarily have any visible styling.
  46
+ * `[api:FieldGroup] attached in CMS-context.
  47
+ * `[api:FieldList]`: Basic container for sequential fields, or nested fields through CompositeField.
  48
+ * `[api:TabSet]`: Collection of fields which is rendered as separate tabs. Can be nested.
  49
+ * `[api:Tab]`: A single tab inside a `TabSet`
  50
+ * `[api:ToggleCompositeField]`: Allows visibility of a group of fields to be toggled.
  51
+ * `[api:ToggleField]`: ReadonlyField with added toggle-capabilities - will preview the first sentence of the contained text-value, and show the full content by a javascript-switch.
46 52
 
47 53
 ## Files
48 54
 
49  
-*  `[FileField](api:FileField)`: Simple file upload dialog.
50  
-*  `[UploadField](api:FileIFrameField)`: File uploads through HTML5 features, including upload progress, preview and relationship management.
  55
+ * `[api:FileField]`: Simple file upload dialog.
  56
+ * `[api:UploadField]`: File uploads through HTML5 features, including upload progress, preview and relationship management.
51 57
 
52 58
 ## Relations
53 59
 
54  
-*  `[ComplexTableField](api:ComplexTableField)`: Provides a tabuar list in your form with view/edit/add/delete links to modify
55  
-records with a "has-one"-relationship (in a lightbox-popup).
56  
-*  `[HasManyComplexTableField](api:HasManyComplexTableField)`
57  
-*  `[HasOneComplexTableField](api:HasOneComplexTableField)`
58  
-*  `[LanguageDropdownField](api:LanguageDropdownField)`:  An extension to dropdown field, pre-configured to list languages.
59  
-Tied into i18n.
60  
-*  `[ManyManyComplexTableField](api:ManyManyComplexTableField)`
61  
-*  `[TableField](api:TableField)`
62  
-*  `[api:TableListField]`
63  
-*  `[TreeDropdownField](api:TreeDropdownField)`
64  
-*  `[TreeMultiselectField](api:TreeMultiselectField)`: represents many-many joins using a tree selector shown in a
65  
-dropdown-like element
66  
-*  `[api:WidgetArea]`
67  
-* `[GridField](/topics/grid-field)`
68  
-
  60
+ * `[api:CheckboxSetField]`: Displays a set of checkboxes as a logical group.
  61
+ * `[api:TableField]`: In-place editing of tabular data.
  62
+ * `[api:TreeDropdownField]`: Dropdown-like field that allows you to select an item from a hierarchical AJAX-expandable tree.
  63
+ * `[api:TreeMultiselectField]`: Represents many-many joins using a tree selector shown in a dropdown-like element
  64
+ * `[api:GridField](/topics/grid-field)`: Displays a `[api:SS_List]` in a tabular format. Versatile base class which can be configured to allow editing, sorting, etc.
  65
+ * `[api:ListboxField]`: Multi-line listbox field, through `<select multiple>`.
69 66
 
70 67
 
71  
-## Dataless/Utility
  68
+## Utility
72 69
 
73  
-*  `[DatalessField](api:DatalessField)` - Base class for fields which add some HTML to the form but don't submit any data or
  70
+ * `[api:DatalessField]` - Base class for fields which add some HTML to the form but don't submit any data or
74 71
 save it to the database
75  
-*  `[HeaderField](api:HeaderField)`: Renders a simple `<h1>`-`<h6>` header
76  
-*  `[HiddenField](api:HiddenField)`
77  
-*  `[LabelField](api:LabelField)`
78  
-*  `[LiteralField](api:LiteralField)`: Renders arbitrary HTML into a form.
79  
-
80  
-## CMS Field Editor
81  
-
82  
-Please see `[api:HTMLEditorField]` for in-depth documentation about custom forms created through a GUI in the CMS,
83  
-as well as the topic documentation about [Rich Text Editing](/topics/rich-text-editing)
  72
+ * `[api:HeaderField]`: Renders a simple HTML header element.
  73
+ * `[api:HiddenField]`
  74
+ * `[api:LabelField]`: Simple label tag. This can be used to add extra text in your forms.
  75
+ * `[api:LiteralField]`: Renders arbitrary HTML into a form.
2  forms/ConfirmedPasswordField.php
... ...
@@ -1,6 +1,6 @@
1 1
 <?php
2 2
 /**
3  
- * Shows two password-fields, and checks for matching passwords.
  3
+ * Two masked input fields, checks for matching passwords.
4 4
  * Optionally hides the fields by default and shows
5 5
  * a link to toggle their visibility.
6 6
  * 
6  forms/CreditCardField.php
... ...
@@ -1,6 +1,10 @@
1 1
 <?php
2 2
 /**
3  
- * CreditCard field, contains validation and formspec for creditcard fields.
  3
+ * Allows input of credit card numbers via four separate form fields,
  4
+ * including generic validation of its numeric values.
  5
+ * 
  6
+ * @todo Validate
  7
+ * 
4 8
  * @package forms
5 9
  * @subpackage fields-formattedinput
6 10
  */
5  forms/CurrencyField.php
... ...
@@ -1,6 +1,9 @@
1 1
 <?php
2 2
 /**
3  
- * Currency field.
  3
+ * Renders a text field, validating its input as a currency.
  4
+ * Limited to US-centric formats, including a hardcoded currency
  5
+ * symbol and decimal separators.
  6
+ * See {@link MoneyField} for a more flexible implementation.
4 7
  * 
5 8
  * @todo Add localization support, see http://open.silverstripe.com/ticket/2931 
6 9
  *
4  forms/EmailField.php
... ...
@@ -1,6 +1,8 @@
1 1
 <?php
2 2
 /**
3  
- * Text field with Email Validation.
  3
+ * Text input field with validation for correct email format
  4
+ * according to RFC 2822.
  5
+ * 
4 6
  * @package forms
5 7
  * @subpackage fields-formattedinput
6 8
  */
5  forms/FormAction.php
... ...
@@ -1,9 +1,6 @@
1 1
 <?php
2 2
 /**
3  
- * Single action button.
4  
- * The action buttons are <input type="submit"> tags.
5  
- * 
6  
- * <b>Usage</b>
  3
+ * The action buttons are <input type="submit"> as well as <button> tags.
7 4
  * 
8 5
  * Upon clicking the button below will redirect the user to doAction under the current controller.
9 6
  * 
4  forms/NumericField.php
... ...
@@ -1,7 +1,7 @@
1 1
 <?php
2 2
 /**
3  
- * A Single Numeric field extending a typical 
4  
- * TextField but with validation.
  3
+ * Text input field with validation for numeric values.
  4
+ * 
5 5
  * @package forms
6 6
  * @subpackage fields-formattedinput
7 7
  */
1  forms/OptionsetField.php
... ...
@@ -1,7 +1,6 @@
1 1
 <?php
2 2
 /**
3 3
  * Set of radio buttons designed to emulate a dropdown.
4  
- * It even uses the same constructor as a dropdown field.
5 4
  * 
6 5
  * This field allows you to ensure that a form element is submitted is not optional and is part of a fixed set of 
7 6
  * data. This field uses the input type of radio. It's a direct subclass of {@link DropdownField}, 
2  forms/SelectionGroup.php
... ...
@@ -1,6 +1,6 @@
1 1
 <?php
2 2
 /**
3  
- * SelectionGroup represents a number of fields that are selectable by a radio 
  3
+ * SelectionGroup represents a number of fields which are selectable by a radio 
4 4
  * button that appears at the beginning of each item.  Using CSS, you can 
5 5
  * configure the field to only display its contents if the corresponding radio 
6 6
  * button is selected.

0 notes on commit a9fa281

Please sign in to comment.
Something went wrong with that request. Please try again.