Unified form validation handling

This commit is contained in:
Bernd Bestel
2022-03-30 18:00:28 +02:00
parent 77d75d16df
commit fbb84277bf
29 changed files with 72 additions and 82 deletions

View File

@@ -73,11 +73,11 @@ $('#location-form input').keyup(function(event)
$('#location-form input').keydown(function(event)
{
if (event.keyCode === 13) //Enter
if (event.keyCode === 13) // Enter
{
event.preventDefault();
if (document.getElementById('location-form').checkValidity() === false) //There is at least one validation error
if (!Grocy.FrontendHelpers.ValidateForm('location-form'))
{
return false;
}