8.2. Form Actions

Interchange form processing is based on an action and a todo. This can be gated with mv_form_profile to determine actions and form values based on a check for required values or other preconditions.

The predefined actions at the first level are:

   process       process a todo
   search        form-based search
   scan          path-based search
   order         order an item

Any action can be defined with ActionMap.

The process action has a second todo level called with mv_todo or mv_doit. The mv_todo takes preference over mv_doit, which can be used to set a default if no mv_todo is set.

The action can be specified with any of:

page name

            <FORM ACTION="/cgi-bin/simple/search" METHOD=POST>
            <INPUT NAME=mv_searchspec>
            </FORM>
            <FORM ACTION="[area search]" METHOD=POST>
            <INPUT NAME=mv_searchspec>
            </FORM>
            <FORM ACTION="[process]" METHOD=POST>
            <INPUT TYPE=hidden NAME=mv_todo VALUE=search>
            <INPUT NAME=mv_searchspec>
            </FORM>

mv_action

            <FORM ACTION="[area foo]" METHOD=post>
            <INPUT TYPE=hidden NAME=mv_action VALUE=search>
            <INPUT NAME=mv_searchspec>
            </FORM>

The second level todo for the process action has these defined by default:

   back         Go to mv_nextpage, don't update variables
   search   Trigger a search
   submit   Submit a form for validation (and possibly a final order)
   go       Go to mv_nextpage (same as return)
   return   Go to mv_nextpage, update variables
   set      Update a database table
   refresh  Go to mv_orderpage|mv_nextpage and check for
            ordered items
   cancel   Erase the user session

If a page name is defined as an action with ActionMap or use of Interchange's predefined action process, it will cause form processing. First level is setting the special page name process, or mv_action set to do a form process, the Interchange form can be used for any number of actions. The actions are mapped by the ActionMap directive in the catalog configuration file, and are selected on the form with either the mv_todo or mv_doit variables.

To set a default action for a process form, set the variable mv_doit as a hidden variable:

   <INPUT TYPE=hidden NAME=mv_doit VALUE=refresh>

When the mv_todo value is not found, the refresh action defined in mv_doit will be used instead.

More on the defined actions:

back

cancel

refresh

return

search

submit