[DE] Fill required fields before send form

This commit is contained in:
Julia Radzhabova 2021-06-18 11:14:43 +03:00
parent e8d9a42d3e
commit 84d03010f8
3 changed files with 15 additions and 1 deletions

View file

@ -233,6 +233,18 @@ define([
}, },
onSubmitClick: function() { onSubmitClick: function() {
if (!this.api.asc_IsAllRequiredFormsFilled()) {
var me = this;
Common.UI.warning({
msg: this.view.textRequired,
callback: function() {
me.api.asc_MoveToFillingForm(true, true, true);
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
}
});
return;
}
this.api.asc_SendForm(); this.api.asc_SendForm();
Common.NotificationCenter.trigger('edit:complete', this.toolbar); Common.NotificationCenter.trigger('edit:complete', this.toolbar);
}, },

View file

@ -388,7 +388,8 @@ define([
tipPrevForm: 'Go to the previous field', tipPrevForm: 'Go to the previous field',
tipNextForm: 'Go to the next field', tipNextForm: 'Go to the next field',
tipSubmit: 'Submit form', tipSubmit: 'Submit form',
textSubmited: 'Form submitted successfully' textSubmited: 'Form submitted successfully',
textRequired: 'Fill all required fields to send form.'
} }
}()), DE.Views.FormsTab || {})); }()), DE.Views.FormsTab || {}));
}); });

View file

@ -1794,6 +1794,7 @@
"DE.Views.FormsTab.tipSubmit": "Submit form", "DE.Views.FormsTab.tipSubmit": "Submit form",
"DE.Views.FormsTab.tipTextField": "Insert text field", "DE.Views.FormsTab.tipTextField": "Insert text field",
"DE.Views.FormsTab.tipViewForm": "View form", "DE.Views.FormsTab.tipViewForm": "View form",
"DE.Views.FormsTab.textRequired": "Fill all required fields to send form.",
"DE.Views.HeaderFooterSettings.textBottomCenter": "Bottom center", "DE.Views.HeaderFooterSettings.textBottomCenter": "Bottom center",
"DE.Views.HeaderFooterSettings.textBottomLeft": "Bottom left", "DE.Views.HeaderFooterSettings.textBottomLeft": "Bottom left",
"DE.Views.HeaderFooterSettings.textBottomPage": "Bottom of Page", "DE.Views.HeaderFooterSettings.textBottomPage": "Bottom of Page",