|> Home > Documentation > Latest documentation > Interchange forms > Interchange form actions|
Interchange form actions
Interchange form processing is based upon an action (first level) and a todo (second level). This can be gated with the mv_form_profile variable to determine which action should be called, and which form values should be set, based upon whatever checks and preconditions are required by your application.
First level actions
First level actions can be called by page name, or by setting the mv_action variable in a form.
Predefined first level actions are as follows:
Additional actions can be defined using the ActionMap configuration directive.
As mentioned above, the first level action can be specified with a page name or via the mv_action variable. For example:
Calling an action using the page name
Calling the "search" page will request the "search" action and calling the "process" page will request the process action etc.
The above causes a simple text search of the DefaultTables table(s).
The [process] tag is often seen in Interchange forms. The above example can be rewritten as follows:
Calling an action using mv_action
Setting the mv_action form variable causes the page name to be ignored as the action source. The above examples can use this as a synonym:
Second level actions
If the first level action is "process" then the following second level todo actions will be available:
Additional second level form actions can be defined using the FormAction configuration directive.
To specify a default second level form action, set mv_doit as a "hidden" variable, as follows:
The pre-defined second-level actions are as follows:
Goes to the page in mv_nextpage. No user variable update.
Checks for newly-ordered items in mv_order_item, (also looking for on-the-fly items, if defined), then updates the shopping cart with any changed quantities or options. Finally updates the user variables and returns to the page defined in mv_orderpage or mv_nextpage (in that order of preference).
Updates the user variables and returns to the page defined in mv_nextpage.
The shopping cart and user variables are updated, then the form variables are interpreted and the search specification contained therein is dispatched to the search engine. Results are returned on the defined search page, as set using the mv_search_page variable.
Update a table in the database.
Submits the form for order processing. If no order profile is defined with the mv_order_profile variable then the order will be checked to see if the current cart contains any items. If so then the order will be submitted for finalisation.
If an order profile is defined then the form will be checked against the defined rules and only submitted if the profile's "&final" pragma is set true.