Add option to hide form error message

This commit is contained in:
Oliver Walters 2021-03-15 20:30:18 +11:00
parent b17a50bd51
commit 2de879d2ba
2 changed files with 5 additions and 3 deletions

View File

@ -241,6 +241,7 @@
"{% url 'part-pricing' part.id %}", "{% url 'part-pricing' part.id %}",
{ {
submit_text: 'Calculate', submit_text: 'Calculate',
hideErrorMessage: true,
} }
); );
}); });

View File

@ -739,9 +739,10 @@ function handleModalForm(url, options) {
// Form was returned, invalid! // Form was returned, invalid!
else { else {
var warningDiv = $(modal).find('#form-validation-warning'); if (!options.hideErrorMessage) {
var warningDiv = $(modal).find('#form-validation-warning');
warningDiv.css('display', 'block'); warningDiv.css('display', 'block');
}
if (response.html_form) { if (response.html_form) {
injectModalForm(modal, response.html_form); injectModalForm(modal, response.html_form);