mirror of
https://github.com/grocy/grocy.git
synced 2025-08-16 10:44:37 +00:00
Unified form validation handling
This commit is contained in:
@@ -110,7 +110,7 @@ $('#quantityunit-form input').keyup(function(event)
|
||||
$("#qu-conversion-headline-info").text("");
|
||||
}
|
||||
|
||||
if (document.getElementById('quantityunit-form').checkValidity() === false) //There is at least one validation error
|
||||
if (!Grocy.FrontendHelpers.ValidateForm('quantityunit-form'))
|
||||
{
|
||||
$("#qu-conversion-add-button").addClass("disabled");
|
||||
}
|
||||
@@ -124,11 +124,11 @@ $('#quantityunit-form input').keyup(function(event)
|
||||
|
||||
$('#quantityunit-form input').keydown(function(event)
|
||||
{
|
||||
if (event.keyCode === 13) //Enter
|
||||
if (event.keyCode === 13) // Enter
|
||||
{
|
||||
event.preventDefault();
|
||||
|
||||
if (document.getElementById('quantityunit-form').checkValidity() === false) //There is at least one validation error
|
||||
if (!Grocy.FrontendHelpers.ValidateForm('quantityunit-form'))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user