[Koha-bugs] [Bug 25563] Cannot sub "add order from MARC file" form after alert

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu May 21 12:08:10 CEST 2020


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25563

--- Comment #2 from Jonathan Druart <jonathan.druart at bugs.koha-community.org> ---
Created attachment 105171
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=105171&action=edit
Bug 25563: (bug 24386 follow-up) Don't disable submit button if form has not
been submitted yet

On bug 24386 we prevent double form submission using the our own
preventDoubleFormSubmit JS function.

The problem is that we are checking some conditions, and prevent the
form submission if something is not filled (for instance no checkbox
checked, or no fund selected).

Technically it means that:
- click the submit button
- it submits the form
- we disable the submit button
- we prevent the form to be submitted before something is wrong
At this stage the button is disabled and the form cannot be longer be
submitted.

This patch replaces the "on submit" event of the form with the "on click" event
of the submit button.
Which means we are going to:
- click the submit button
- we prevent the form to be submitted before something is wrong
=> The button will only be disabled if the form is really submitted

Test plan:
- stage a marc record
- acquisitions: have a basket
- click on "Add to basket"
- "From a staged file"
- Don't tick the record
- Save
- You should see an expected error message
- Tick the record
- Save
- You should see an expected error message
- Choose a fund
- Click the "Save" button as many times as you can, to try double submit
it.
=> The order is saved

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.


More information about the Koha-bugs mailing list