diff --git a/101.md b/101.md index 098bda6..31ebc74 100644 --- a/101.md +++ b/101.md @@ -28,27 +28,52 @@ Event `30168` describes a form as a parametrized replaceable event, with `field` The different tags used to detail the form are described as: -| Tags | Description | -| -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| d | The unique identifier of a form, for a user | -| name | A text serving as the name of the form | -| settings | An optional global config for the form. | -| field | Contains the following values | +**d** - The unique identifier of a form, for a user -
indexnamedescription
1FieldIdan id that uniqely identifies a field in the forn
2input-typeA field that describes the type of value that can be expected as a response to this field, values can be: `text`, `option` or `label`
3labelA label for the field
4options Only used for input-type option, is a Json stringified array of option Tags.
- Option Tags Option Tags are defined as: [`, <`label`>, ``], optionId can be any alphanumeric string
5fieldSettingsAn optional JSON stringified object that contains settings specific to the field, for example `renderElement`, a setting which indicates what UI element to render to the client
+**name** - The name of the form` -## Responses - Public +**settings** - A form wide settings object, that can detail styles and visual representation of the form, certain fields in the object may be client specific -Response events are also parametrized replaceable events that are attached to a form(3068 kind event), and the event data is stored in a `kind: 30169` event +**field** - contains the description of a form field. + +## Field Tag + +A field tag is described as the following array: +`["field", FieldId, InputType, Label, Options, Field Settings ]` + +**FieldId** - Is used to identify the field in the form, can be any alphanumeric string. + +**InputType** - Can be one of: "text", "option", "label". All other types can be derived from the text type. + +**Label** - Value that describes the field, can be a question the user needs feedback eg: "What is your age?" + +**Options** - A stringified array of Options in case the user selected an option type. + +**Field Settings** - A stringified JSON that may contain metadata about a field, like wether the field is a "required" field or "prerequisites" for a field. + +## Options + +The options array is a stringified Array of Option Tags, where each option tag is +represented as: +`[,