A list the reader picks from
Offer a list of answers: an open list, a drop-down menu, or a menu the reader may also type an answer into.
Summary
The country, a garment size, the reason for a request: answers made ready in advance. The reader picks from what you offer, which spares typing mistakes and fanciful answers. What the reader reads and what the form keeps can be two different things: they see “France”, the form keeps “FR”.
Technically
Asked for with
"type": "choice_field"
The field is an /FT /Ch field whose /Opt array holds each option as a single string, value and label alike, or as a pair that separates the reported value from the shown label. The /Ff bits pick the presentation — the list you scroll, the drop-down menu, the menu open to typing — and multi-select, which lets the reader choose several options at once. The starting selection and the one a reset restores are given by reported value, and are said separately. The sorted flag declares the list to be in alphabetical order, while reading software shows the options in the order the request gives them: sorting is therefore the request's to do.
Request schema
Required keys: name, a string; rect; font; font_size; options, an array whose entries are each a bare string, or an object with a required value and a required label. Optional keys of the field itself: selected, the reported value of the option chosen to start with; default_selected, the reported value of the option a reset restores; presentation, one of list (default), dropdown or editable; multi_select and sorted, booleans at false; align, one of left (default), center or right. Optional keys shared by every field: read_only, required, no_export, booleans at false; background; border (a required width, a color in light, a style); tooltip and description, strings, absent writing no such entry; mapping_name, a string, the name a submitted form reports the answer under; flags, the flag word described on the text field page, absent printing the field and saying nothing else; triggers, one action per moment, the ten of them listed on the text field page; pages, default empty; relative_to. Cross refusal: a CMYK or named-space colour in border.color.
A whole request that creates a PDF
{
"standard_fonts": [{"name": "sans", "face": "helvetica"}],
"items": [
{
"type": "choice_field",
"name": "country",
"rect": {"llx": 72, "lly": 700, "urx": 260, "ury": 718},
"font": "sans",
"font_size": 11,
"options": [
{"value": "FR", "label": "France"},
{"value": "GB", "label": "United Kingdom"}
],
"presentation": "dropdown",
"border": {"width": 0.75}
}
]
}
Form fields
A field the reader types into A box the reader ticks Several buttons, one answer The place kept for a signature A button the reader presses
Where to go next
Every JSON key of a request, in one page The other twenty-two things you can draw