Add an option to make Userfields mandatory (closes #1339)

This commit is contained in:
Bernd Bestel
2021-07-11 22:05:08 +02:00
parent 21c221b520
commit 6659a5cd08
6 changed files with 74 additions and 15 deletions

View File

@@ -158,6 +158,11 @@ Grocy.Components.UserfieldsForm.Load = function()
input.val(value);
}
});
$("form").each(function()
{
Grocy.FrontendHelpers.ValidateForm(this.id);
});
},
function(xhr)
{
@@ -179,3 +184,11 @@ $(".userfield-link").keyup(function(e)
formRow.find(".userfield-input").val(JSON.stringify(value));
});
$(".userfield-input").change(function(e)
{
$("form").each(function()
{
Grocy.FrontendHelpers.ValidateForm(this.id);
});
});