Webanizr Logo
Open / sluit menu
Module formActions

Last change: February 26, 2021

Current version: 1.19.0

The formActions module performs actions after a form is submitted

syntax

webanizr.collect('formActions', parameters, callack);

parameters

The module accepts the following parameters:

id__form (required)

The id of the form to listen to

list__actions (optional)

The list of actions to perform. Each action is performed after the previous action is completed. Each action can have the following parameters:

type__action (required)

The type of action to perform. The following actions are supported:

  • afterSubmitMessage: show a html message instead of the form
  • historyBack: go one step back in browser history
  • doRedirect:  redirect to an url which is in action parameter url__redirect
  • toWebanizrVar : store the data from a form in a webanizr variable
  • finishMultiStep : finishes multistep with given id, using multistep module
  • cancelSubmit: cancels the submission of a form (and all following actions)
  • saveAsType: saves the data into a type defined by the datamodel

content__message (optional for afterSubmitMessage)

The message to show

name__var (required for toWebanizrVar)

The Webanizr variabele name to store the data in

label__values (optional)

See formValues for more information.

typeid__item (required for saveAsType)

The id of the type to store the data in

token__security (required for saveAsType)

The security token that allows you to performs this task on the server

context__request (optional for saveAsType)

The context to make sure the data is stored in the correct item

text__processing (optional for formValues)

Text to show inside submit button after clicking submit button of the form.

callback

The function to call after all actions are performed

demo

https://cdn.cpmodules.webanizr.com/demo/form-action/index.html

changelog

  • February 26, 2021 1.19,0 - It is now possible to catch the errors and stop execution of the form action
  • September 16, 2020 1.15.0 - Added context into webanizr variables for filtering
  • September 16, 2020 1.14.0 - ???
  • September 16, 2020 1.13.1 - ???
  • September 16, 2020 1.13.0 - ???
  • September 16, 2020 1.12.2 - Focus on div with feedback text, extra class for div with feedback text, form buttons removed when feedback text is shown
  • July 29, 2020 1.11.1 - Removed test console.log
  • July 29, 2020 1.11.0 - Added filterList action
  • July 6, 2020 1.10.6 - Updated dependency to taskModelAPI to 1.2.0
  • April 8, 2020 1.8.0 - added historyBack action
  • March 10, 2020 1.8.0 - added text__processing parameter
  • December 4, 2019, 1.6.0 - now accepts context__request for saveAsType
  • November 26, 2019, 1.5.0 - added cancelSubmit
  • November 6, 2019, 1.3.1 - fix for labels__values
  • November 4 2019, 1.3.0 - added labels__values parameter
  • October 1, 2019, 1.1.0 - added toWebanizrVar action to formActions
  • September 25, 2019: 1.0.0 - first version of the module