Merge pull request #1406 from SchrodingersGat/part-pricing-form-error

Add option to hide form error message
This commit is contained in:
Oliver 2021-03-15 21:01:19 +11:00 committed by GitHub
commit 247cbe0154
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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);