Appsemble 0.12.3
Getting Started
Guide
Architecture
Blocks
Action buttonButton listData loaderDetail viewerFeedFilterFormIntroductionActionsParametersEventsImagesNotesListMapMarkdownStatsTable
Development
Deployment
Reference

Form

Introduction

A block used for inputting and submitting sets of data.

Actions

ActionRequiredDescription
onSubmittrueAction that gets dispatched when the form is submitted
onSubmitSuccessfalseAction that gets dispatched when the form has been submitted successfully

Parameters

ParameterDefaultDescription
fieldsA list of objects describing each field that can be entered in the form
fields[].defaultValueThe default value for the field.
fields[].nameThe name used when storing this field
fields[].labelfield[].nameUser-facing label describing the field
fields[].typestringThe type of the data
fields[].maxWidthThe maximum width of uploaded images
fields[].maxHeightThe maximum height of uploaded images
fields[].qualityThe quality modifier to use when uploading images, in percentages
fields[].requiredfalseWhether the field is required or not. The form input will be validated based on its type.

Events

Listen Events

EventDescription
dataThe event that is triggered when data is received. Compatible data that is received will be displayed and mapped to the fields as defined in the fields parameter.

Field types

Based on the type of field, additional parameters are available.

string (default)

A regular text entry field.

ParameterDescription
fields[].placeholderPlaceholder value displayed when field is empty
fields[].multilineBoolean value representing whether to use a multline text field or a single line text field
number and integer

A number entry field.

Both number and integer represent numbers with the latter representing whole numbers and the former allowing for decimals.

ParameterDescription
fields[].minThe minimum allowed value
fields[].maxThe maximum allowed value
fields[].stepThe size of a step whenever the increment button is pressed
boolean

A checkbox that returns true when checked and false when not.

ParameterDescription
fields[].labelTextThe text that appears next to the checkbox
geocoordinates

A location picker used to select a location.

file

An input field used to upload files.

ParameterDescription
fields[].acceptA list of accepted MIME-types
fields[].repeatedBoolean value representing whether to accept one file or multiple files
enum

A dropdown list containing a list of predetermined values.

ParameterDescription
fields[].placeholderThe name of the default (empty) option when the enum field is not required.
fields[].enum[].valueThe value and name of the field that can be selected
fields[].enum[].labelThe label of the field that can be selected

hidden

A hidden field. This is useful for submitting default values the user may not change.

Images

Form screenshot

Notes

  • Loading initial form data does not work with inputs of type geocoordinates.