Improved form validation handling (closes #1836)

This commit is contained in:
Bernd Bestel
2022-03-26 10:34:00 +01:00
parent 6aae97de73
commit 81b54182de
33 changed files with 180 additions and 17 deletions

View File

@@ -4,6 +4,11 @@ $('#save-shoppinglist-button').on('click', function(e)
{
e.preventDefault();
if (!Grocy.FrontendHelpers.ValidateForm("shoppinglist-form", true))
{
return;
}
if ($(".combobox-menu-visible").length)
{
return;
@@ -284,7 +289,7 @@ eitherRequiredFields.on('input', function()
eitherRequiredFields.not(this).prop('required', !$(this).val().length);
Grocy.FrontendHelpers.ValidateForm('shoppinglist-form');
});
eitherRequiredFields.trigger("input");
if (GetUriParam("product-name") != null)
{