Formish Examples
Some interactive form examples:
Simple Fields
- String -- A simple form with a single string field
- Integer -- A simple form with a single integer field
- Boolean -- A simple form with a single boolean field, defaults to a RadioChoice widget. Add a required validator if you want a checkbox widget.
- Float -- A simple form with a single float field
- Decimal -- A simple form with a single decimal field
- Date -- A simple form with a single date field
- Tuple -- A simple form with a single tuple field of string, integer form
Simple Fields with some options
- String Different Empty -- Simple field but setting the ``empty`` value equal an empty string (instead of None)
- Date Different Empty -- A simple date field but with the ``empty`` attribute value set to todays date
- Boolean With Defaults -- A simple form with a single boolean field
File Fields
- File -- A simple form with a single file field
Simple Widgets
- Input -- Simple input field with a strip parameter
- Input None Value -- Simple input field with a strip parameter and a substitue none_value (allows user to return a None and an empty string). Notice use of schema default value.
- Input Date None Value -- Simple input field with a strip parameter and a substitue none_value (allows user to return a None and an empty string). Notice use of schema default value.
- Hidden -- Hidden Field with a visible friend..
- Password -- Password html widget with string
- Checked Password -- Checked Password widget
- Text Area Simple -- Simple text area
- Text Area Cols And Rows -- Passing cols and rows to a text area
- Text Area Strip -- Text area input with strip true
Default Values
- Integer None Default -- An integer field defaulting to None
Checkbox Widgets
- Checkbox -- Simple Boolean Checkbox
- Checkbox With Defaults -- Simple Boolean Checkbox
Validation Examples
- Required -- Required Fields
- Radio Choice Required -- A basic radio choice
- Checkbox Required -- Simple Boolean Checkbox with a required validator. Add an empty value if you want to force the user to add a tick
- Checkbox Required With Empty Value -- Simple Boolean Checkbox
- Min Length -- Minimum Length fields - this one is min length four chars
- Max Length -- Maximum Length fields - this one is max length eight chars
- Min Max Length -- Minimum and maximum length
- Min Length Checkbox Multi Choice -- A checkbox multi choice with minimum length 3
- Min Range -- Minimum Value fields - this one is min value of 4
- Max Range -- Maximum value for a field - this one is max of 8
- Min Max Range -- Minimum and maximum value
- Plain Text -- Plain Text (alphanum only)
- One Of -- One of a set of
- All -- Required, Integer and Value >= 18
- Any -- Any of the validators passing will mean a pass - implements 'no teenagers please'
- Re CAPTCHA -- ReCAPTCHA widget
- Validation On Sequence Item -- Validation on a sequence item.
- Validation On Sequence -- Validation on a collection (sequence).
- Validation On Sequence Item Text Area -- Validation on a sequence item.
- Required String And File -- A required string and a file field configured for image upload. (so that we can check roundtripping temp file)
Select Widgets
- Select Choice -- A basic select choice
- Select Choice None Option -- Setting a None Option on the select choice element
- Select Choice With Empty String -- A select choice which includes an empty string and a none value
- Select Choice Callable Options -- Passing in a callable list of options
- Select With Other Choice -- A basic select choice with input option
- Radio Choice -- A basic radio choice
- Radio Choice None Option -- Setting a None Option on the radio choice element
- Radio Choice None Option None Default -- Setting a None Option on the radio choice element - default value of None
- Radio Choice Callable Options -- Passing in a callable list of options
- Radio Choice With Defaults -- Simple Radio Choice boolean with defaults
- Select Choice Date -- A select choice that uses dates for values
- Select Choice Sequence Integer -- A select choice that uses dates for values
Defaults
- Select Choice Default -- A select choice that uses dates for values
- Radio Choice Default -- A select choice that uses dates for values
- Select With Other Choice Default -- A basic select choice with input option
- Checkbox Multi Choice Default -- A checkbox representing a set of values
- Sequence Of Strings With Default -- A sequence with some defaults
- Sequence As Input With Default And Delimiter -- A simple text area but representing a csv style data structure
Multi Select Widgets
- Checkbox Multi Choice -- A checkbox representing a set of values
- Checkbox Multi Choice Tree -- A checkbox representing a set of values displayed as tree (using dots for depth)
Structures
- Simple Structure -- A simple structure
- Structure With Readonly -- A simple structure
- Upload Structure -- A structure with a file upload
- Nested Structures -- Allow the emission of parts of a form schema using field names.
Sequences
- Sequence Of Strings -- A sequence with some defaults
- Sequence Of Strings Without Form Name -- A sequence with some defaults
- Sequence Of Strings With Sequence Widget Options -- A sequence with some defaults
Sequence of Structures (using javascript)
- Sequence Of Simple Structures -- A structure witin a sequence, should be enhanced with javascript
- Sequence Of Date Parts -- A test of a sequence of more complicated structures
- Sequence Of Upload Structures -- A structure witin a sequence, should be enhanced with javascript
- Sequence Of Structures With Selects -- A sequence including selects
- Sequence Of Structures -- A test of a sequence of more complicated structures
- Sequence Of Sequences -- A structure witin a sequence, should be enhanced with javascript
- Sequence Of Sequences As Text Area -- A simple text area but representing a csv style data structure
- Sequence Of Structures Grid Widget -- Using a table structure to edit a sequence of dicts
Customised, Granular Form Layout
- Granular Form Layout -- A simple demonstration of partial rendering of parts of forms.
- Customised Form Layout -- A custom form
- Customised Form Layout With Sequence -- A custom form
- Customised Form Layout Fields -- Allow the emission of parts of a form schema using field names.
Example from Formish Docs for embedding in Restish
- Restish Example -- The form used in the restish examples