Skip to content
Anjunar/ DOCS

Form field

An Ember document can be submitted as Markdown or lossless JSON through one named form control.

Concept

One submitted value

EditorFormBinding chooses whether the document or a source draft owns the current value. EditorFieldView provides a named textarea that still works without JavaScript.

Inspect the source

This live editor illustrates the document and source; the form integration itself uses EditorFieldView.

Form body

A document that can be submitted as Markdown or JSON.

12 words · 5 nodes
# Form body A document that can be submitted as Markdown or JSON.
Source

Bind a form field

Strict Markdown refuses unsupported content; JSON preserves registered custom node types.

scala
val mediaPolicy = MediaUrlPolicy.default val rules = MarkdownSupports.everything(LinkUrlPolicy.default, mediaPolicy) val field = EditorFields.markdown( "body", rules, generator, loss = LossPolicy.Strict ) val binding = new EditorFormBinding(session, field) val valueForSubmit: String = binding.submitValue // For a lossless document field: val codecs = StandardJsonSupport.everything(media = mediaPolicy) ++ TableSupport.json val jsonField = EditorFields.json("body", codecs)