Development Guide
Please note: This document is no longer actively maintained. For up-to-date information, please refer to the documentation on GitHub and the collection of development how-tos here.
Buttons: Preventing double submission
This feature has been moved to the Kitchen Sink Documentation.
This feature has been introduced for ILIAS 5.0.
To prevent double form submissions a javascript method parses the page content and adds mark-up to certain elements.
See
This is done automatically for the following HTML elements if they have a CSS class "preventDoubleSubmission":
On click/submit these elements will be deactivated until the next page reload. This leads to a problem if this page reload never happens. Scenarios for this are:
See
/Services/JavaScript/js/Basic.js - preventDoubleSubmission()This is done automatically for the following HTML elements if they have a CSS class "preventDoubleSubmission":
- form submits
- links
- textareas
On click/submit these elements will be deactivated until the next page reload. This leads to a problem if this page reload never happens. Scenarios for this are:
- file download / export buttons
- forms in layers
The handling of link- or submit-buttons in ILIAS might be refactored in the near future. It is bad practice to use hard-wired css classes in PHP like "[omit]PreventDoubleSubmission" or "emphSubmit" (for the primary action on a page).
JL 28 Jul 2014: Prototypes for ilLinkButton and ilSubmitButton have been added to the trunk (
The button classes should be used at least in all cases where
/Services/UIComponent/Button/). Both ilToolbarGUI[::addButtonInstance()] and ilTable2GUI[::addCommandButtonInstance()] are compatible with these button classes.The button classes should be used at least in all cases where
- the primary action is to be marked:
ilButton::setPrimary(true); - the double submission prevention needs to be disabled:
ilButton::setOmitPreventDoubleSubmission();