Autoform.js
Autoform is part of the standard pipeline for sending intents to a Service
.
It automagically gathers and includes form data with the data that is being piped to the Service.
It can be thought of as a organizer for form data.
Autoform is a part of the approach.autoform.js
module.
and can be used to better improve the Interface
and Service
interaction.
Working
Autoform looks for forms that have the Autoform
class, then based on the data-action
attribute,
form data is grouped and piped to the Service.
Autoform has to always be used in a node that is recognized as an Interface
, ie it’s parent should have
an Interface
class.
Example
Notice the Autoform
class and the data-action
attribute. This is the minimum requirement for Autoform to work.
Now, to “submit” the form, you can use a button with the data-role="autoform
attribute.
This sends the intent to the server with the following data:
Use Cases
Autoform can be used to build complex forms and automagically categorize form data. It can be used to build surveys, feedback forms and much more.