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

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