Rendering form fields in ISML from the server form object
Key Takeaway
A template can read a form object through pdict only if the controller puts that form object in the object it passes to res.render, because each key of that object becomes a pdict property.
In B2C Commerce, a complex storefront form starts as an XML form definition. The controller turns that definition into a server-side form object and passes it to an ISML template. The template reads the form through the pdict variable. The form definition holds the fields, validation and labels, while the template holds the HTML that the customer sees.
When to use a form definition
Use a form definition when a form stores data, needs server-side validation, or has complex localization needs. A simple form that stores nothing and only needs client-side validation can be a plain HTML form.
A form definition is an XML file that lists each field and the form's actions, such as submit and cancel. For each field it gives details such as formid, label, type, mandatory and max-length.