{form:form_id:ok_code}

Description

Renders a stored AA form by its form id, as an inline item-submission form a visitor can fill in and post. The form must first be defined and saved in the slice Forms admin (se_forms.php); the form id is that saved form object id, not a slice id or a view id. The output is a fieldset holding the form field rows, hidden inline and slice_id inputs, and an Insert button that posts the entry through filler.php. The first parameter form_id selects the form. The optional second parameter ok_code is placed in the form hidden ret_code input and is used as the response shown after a visitor successfully inserts an item. An empty form_id yields an empty string; any non-empty value loads a form (an unknown id loads an empty one) and emits the fieldset wrapper. The command is never cached, since the form HTML is rebuilt on every request, and the wrapper id is randomized per render.

Parameters

form_id required default (empty string)

Object id of a stored AA form, defined and saved in the slice Forms admin. It is a form object id, not a slice id or a view id. An empty value returns an empty string; a non-empty value that does not match a saved form loads an empty form and still emits the fieldset wrapper.

ok_code optional default (empty string)

Return code placed in the form hidden ret_code input. It is used as the response after a visitor successfully inserts an item through the form, and may hold plain text or template code (for example a thank-you message or a redirect).

Examples

virtual{form:09142343c7833cf0b189708d5ea454b3:Thank you, {spotnumber}.}
Expected(the form, with ret_code holding the expanded success message)
Actual
ok_code may hold template code, not only plain text. Whatever it contains is expanded and stored in ret_code as the success response. Use a non-side-effecting expression here; a command like redirect would fire on every render.
test[{form:}]
Expected[]
Actual[]
With no form id the command returns an empty string. This is the only fully deterministic case; any non-empty id produces live form markup.
virtual{form:09142343c7833cf0b189708d5ea454b3}
Expected(the saved form rendered as an inline Insert form)
Actual
The typical use: pass the id of a form saved in the slice Forms admin. The output is a ready-to-post item-submission form (a fieldset of that form field rows and an Insert button that posts through filler.php). Output is live markup, so this is illustrative rather than a text test.
virtual{form:09142343c7833cf0b189708d5ea454b3:Thank you for your submission.}
Expected(the form, with ret_code set to the thank-you message)
Actual
The second parameter ok_code lands verbatim in the form hidden ret_code input. Here it carries a thank-you message shown after a visitor inserts an item.
virtual{form:00000000000000000000000000000000}
Expected(a fieldset with an Insert button and no field rows)
Actual
A non-empty id always loads a form. An id that matches no saved form loads an empty one, so the output is the fieldset wrapper (hidden inline and slice_id inputs plus the Insert button) with no field rows. The wrapper id is randomized per request.