Form

Apart from fields, form component usually includes form_actions wrapper for buttons, and form_errors block for error reporting. It also supports enctype and method attributes, which default to application/x-www-form-urlencoded and GET, respectively.

When method of the form set to POST, CSRF token is automatically included into output. To enforce omission of the token, set include_csrf to false.

{%- call ui.util.call(show_example) -%} {%- raw %} {%- call ui.util.call(ui.form, method="POST", enctype="multipart/form-data") -%} {{ ui.form_errors({"Title": "Must be provided"}) }} {{ ui.form_annotation() }} {%- call ui.util.call(ui.form_actions) -%} {{ ui.button("Submit", type="submit", attrs={"name": "action", "value": "save"}) }} {%- endcall %} {%- endcall %} {%- endraw %} {%- endcall %}