mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
N°2560 Prevent double submit on forms
This commit is contained in:
@@ -124,6 +124,13 @@ function OnUnload(sTransactionId, sObjClass, iObjKey, sToken)
|
||||
|
||||
function OnSubmit(sFormId)
|
||||
{
|
||||
if($('#'+sFormId).attr('data-form-state') === 'onsubmit')
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
$('#'+sFormId).attr('data-form-state','onsubmit');
|
||||
|
||||
window.bInSubmit=true; // This is a submit, make sure that when the page gets unloaded we don't cancel the action
|
||||
|
||||
if ($('#'+sFormId).data('force_submit')) {
|
||||
@@ -134,6 +141,7 @@ function OnSubmit(sFormId)
|
||||
if (!bResult)
|
||||
{
|
||||
window.bInSubmit = false; // Submit is/will be canceled
|
||||
$('#'+sFormId).attr('data-form-state', 'default');
|
||||
}
|
||||
return bResult;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user