Feature Wiki

Information about planned and released features

Tabs

Avoiding Double Form Submission

1 Description

1.1 Goals of first implementation

Double submissions should be prevented in
  • standard ILIAS forms, toolbars and tables and
  • in the learners view of test and assessment (especially when sending answers for questions).
Forms activate the feature using a special style class, e.g. "ilPreventDoubleSubmits". Submit buttons should show a visual change (greyed out) but not being disabled via HTML, since this leads to issues in IE (see possible jQuery solution under "Additional Information").
 
This first solution would not work after page reload is invoked by the user.
 
Exceptions of this behaviour should be explained in the Jour Fixe (and be documented on the guideline page).

1.2 Original Idea (German)

Wir haben überlegt, dass man ja zumindest in der FormGUI einbauen könnte, dass nach dem Abschicken der "Submit"-Button disabled wird, sodass man das Formular nicht nochmal durch Anklicken abschicken kann (das wäre ja recht einfach per jQuery zu lösen; vielleicht kann man dort auch noch eine kleine Sanduhr laufen oder ein Rädchen drehen lassen o.ä.).
Und eine zweite Verbesserung wäre, wenn man verhindern würde, dass das selbe Formular durch Reload o.ä. mehrfach abgeschickt werden kann.

2 Status

3 Additional Information

  • If you want to know more about this feature, its implementation or funding, please contact: Jens Conze / jc [at] databay [dot] de and/or Alex Killing alex.killing [at] gmx.de

4 Discussion

JF 24 Okt 2011: Jens, we have a patched ILIAS version, that does exactly that. We will add this for 4.3.
 

Alex 10 Feb 2012: I have recently seen the Databay solution and I think we should discuss the solutions in details. I guess a combination of both could fit our needs.

JF 22 Feb 2012: We postpone the conceptual discussion to the next JF and hope that someone from Databay will find the time to participate.

Matthias Kunkel, 28 Feb 2012: Would such a function that avoids double form submission become a general feature for all submit buttons? Or do we need to specify for which forms and pages in ILIAS it is used (and for which not)?

JF 5 Mar 2012: There are two main conceptual questions:
  • Which UI elements should avoid additional requests?
    • All form submit buttons
    • Login Screen
    • Submit buttons in tests and surveys, (start test, next question, ...)
    • Search
    • Language Update
    • Exports
    • Downloads
    • Statistics/Reports
    • Course/Group registrations
    • Payment Buy Button
    • Confirmation Screens
    • Every request?
  • Which other elements should be deactivated, when a request is sent?
    • Modal Dialog (Uni Köln Patch): Does not allow any subsequent request (all elements are deactivated)
      • The presentation of the dialog could be triggered after a certain time period (e.g. 2 seconds)
    • Deactivate only form submit buttons (ADN patch): Does allow to use e.g. main menu and tabs
    • Saving message in page editor: No deactivation, only message that request is being processed
  • Other Options
    • Move processing into background-processes (e.g. export, language update, ...)

JF 5 Mar 2012: We will include both versions in a 4.3 prototype and continue the discussion.

Pascal, 11.03.13: On our installation the pain point is the "download of folders" function. If a user wants to download a folder of the size up to 5GB the server gets very slow and this for quite a long time. We implemented a "avoid double click" patch (simple javascript) but users are clever enough to reload the page and then start the download again... Now the server has to zip two 5GB files. Of course we don't realy compress the files anymore but only build a zip-file.
I don't see an other solution than running the zip command in a background-process incl. caching, lower priority,... and inform the user after the process has finished.
Shall I make a new feature wiki entry for this?

Matthias Kunkel, 15 Sep 2013: We are discussing this feature now for almost two years and have already scheduled it for 4.3. But there is still no implementation for the trunk. Will we be able to realise this feature for 4.4?

Postponed to 4.5

JE 7 Nov 2013: This feature ist postponed to next version twice now. If an implementation is that easy with jquery, you have ready patches and no funding is needed what can we do to get this feature? Please discuss at JF.

AK 28 Feb 2014: JE, you are right. It was a mistake to set the funding to "Not Required". This gave the issue a lower priority than all funded features which made it the first one ot be postponed if we run short of ressources at the end of a release development. I set it back to "required".

JE 5 Mar 2014: Removed from JF agenda. Nothing to diskuss after AKs answer.

JE 10 Mar 2014: Should "Avoiding double form submission" become part of Form Guideline? Please discuss at JF.

JF 17 Mar 2014: Yes, this behaviour should be part of the form guideline.

SM 26 Mar 2014: It would be nice if you could enable this for every link. I did a simple jQuery function for this and reduced duplicated requests to nearly zero. Whenever clicked, i disable a link for the next 5 seconds (except for dropdown menus)

5 Implementation

Current Implementation (4 May 2014) acts on the selector:
  • form.preventDoubleSubmission
  • input:submit,
  • .preventDoubleSubmission
  • a.submit,
  • a.preventDoubleSubmission
 
If one of these elements is clicked, all forms and links matching this selector will be deactivated.
 
For details see Services/Javascript/js/Basic.js, search for preventDoubleSubmission

JL 10 Jul 2014: There are some cases where the prevention of double form submission does not work as intented, e.g. file downloads, export buttons or forms in layers (the submit buttons are deactivated but the page is not reloaded so they stay inactive). Please add the css class "omitPreventDoubleSubmission" to those buttons or forms to do just that.

Last edited: 17. Apr 2025, 14:47, Kunkel, Matthias [mkunkel]