Form builder

Functions

Util.Form.addForm

Definition

Name
Util.Form.addForm
Syntax
Node Form = Util.Form.addForm( Node node [, JSON _options ] );

Description

Create HTML form, append it to node, and return it.

Parameters

node
Node node to append form to
_options
JSON JSON object with form options
Options
name
Form name
action
Form action
method
Form method
class
Form class

Return values

Node Newly created form

Examples

No examples

Dependencies

JavaScript
  • typeof
  • switch ... case
  • for ... in
Manipulator
  • Util.appendElement

Util.Form.addFieldset

Definition

Name
Util.Form.addFieldset
Syntax
Node Fieldset = Util.Form.addFieldset( Node node [, JSON _options ] );

Description

Create HTML fieldset, append it to node, and return it.

Parameters

node
Node node to append fieldset to
_options
JSON JSON object with fieldset options
Options
class
Fieldset class

Return values

Node Newly created fieldset

Examples

No examples

Dependencies

JavaScript

None

Manipulator
  • Util.appendElement

Util.Form.addField

Definition

Name
Util.Form.addField
Syntax
Node Field = Util.Form.addField( Node node [, JSON _options ] );

Description

Create HTML div.field (input wrapped in div), append it to node, and return it.

Parameters

node
Node node to append field to
_options
JSON JSON object with field options
Options
label
Input label
name
Input name
value
Input value
type
Input type
options
Options for radiobuttons or selects
checked
Checkbox checked-state
class
Input class
id
Input id
max
Max length/date/number
min
Min length/date/number
pattern
Regular expression pattern to be matched
required
Set the field required state
disabled
Set the field to disabled
readonly
Set the field to readonly
hint_message
Text to be shown as hint
error_message
Text to be shown on validation error

Return values

Node Newly created field

Examples

No examples

Dependencies

JavaScript
  • typeof
  • switch ... case
  • for ... in
Manipulator
  • Util.appendElement

Util.Form.addAction

Definition

Name
Util.Form.addAction
Syntax
Node Form = Util.Form.addAction( Node node [, JSON _options ] );

Description

Create HTML action (button), append it to node, and return it.

Parameters

node
Node node to append action to
_options
JSON JSON object with form options
Options
name
Action name
type
Action type
value
Action value
class
Action class

Return values

Node Newly created Action

Examples

No examples

Dependencies

JavaScript
  • typeof
  • switch ... case
  • for ... in
Manipulator
  • Util.querySelector
  • Util.appendElement
  • Util.parentNode
  • Util.hasClass

Files

Main file

  • u-form-builder.js

Segment support files

  • none

Segment dependencies

desktop_edge
u-form-builder.js + u-dom.js
desktop_ie11
u-form-builder.js + u-dom.js
desktop
u-form-builder.js + u-dom.js
desktop_ie10
u-form-builder.js + u-dom.js + u-dom-desktop_ie.js +
desktop_ie9
u-form-builder.js + u-dom.js + u-dom-desktop_ie.js
desktop_light
u-form-builder.js + u-dom.js + u-dom-desktop_light.js
tablet
u-form-builder.js + u-dom.js
tablet_light
u-form-builder.js + u-dom.js
smartphone
u-form-builder.js + u-dom.js
mobile
not tested
mobile_light
not tested
tv
u-form-builder.js + u-dom.js + u-dom-desktop_light.js
seo
not supported