JQAjaxFormContrib

%$SHORTDESCRIPTION%

Description

This packages is a simple jQuery library to help ajaxifying forms. Any form with a class jqAjaxForm will be ajaxified using its HTML5 data attributes to parametrize it.

Parameters

Name Description Default
data-block boolean flag whether to block the UI as long as the form is being processed by the backend true
data-dialog may be "destroy" or "close"  
data-message message to be displayed while the UI is being blocked  
data-redirect target to redirect the browser on success, see below for more information  
data-reload boolean flag to enable page reloading, see more on redirect below false

There are multiple way how the browser is reacting after the form has been processsed successfully.

  1. use the redirect response of the backend returns a json object {result: { ..., redirect: "...", ...} ...} or
  2. use the redirect as specified in the form itself in a &jt;input name="redirect" value="..." > element or
  3. use the data-redirect HTML5 attribute or
  4. reload the current page if specified in the data-reload boolean parameter

JavaScript Events

The jqAjaxForm will receive events that third party scripts might listen to in order to participate on the form being processed:

  • beforeSerialize: called before the form data is serialized
  • beforeSubmit: called before the form is submitted
  • uploadProgress: called when uploading of data
  • error: called when the backend returned an error
  • success: called when the backend returned successfully
  • complete: called when the form has been fully processed

Installation Instructions

%$INSTALL_INSTRUCTIONS%

Dependencies

%$DEPENDENCIES%

Change History

16 Mar 2026 better support for ui-dialogs
19 Nov 2024 added data-dialog parameter
22 Jan 2024 block submitting the form when it is not valid; added javascript callbacks for beforeSubmit, uploadProgress, error, success and complete events
04 May 2022 fixed name of jquery module; make callback handlers of ajaxForm available in AjaxForm class; export AjaxForm in global namespace
14 Oct 2020 initial release

PackageForm edit

Author Michael Daum
Version %$VERSION%
Release %$RELEASE%
Description %$SHORTDESCRIPTION%
Repository https://github.com/foswiki/%$ROOTMODULE%
Copyright 2020-2026, Michael Daum, All Rights Reserved
License GPL (GNU General Public License)
Home http://foswiki.org/Extensions/%$ROOTMODULE%
Support http://foswiki.org/Support/%$ROOTMODULE%
Topic revision: r1 - 16 Mar 2026, ProjectContributor
This site is powered by FoswikiCopyright © by the contributing authors. All material on this site is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback