mirror of
https://github.com/grocy/grocy.git
synced 2025-08-18 03:25:50 +00:00
Unified form validation handling
This commit is contained in:
@@ -86,11 +86,11 @@ $('#chore-form input').keyup(function(event)
|
||||
|
||||
$('#chore-form input').keydown(function(event)
|
||||
{
|
||||
if (event.keyCode === 13) //Enter
|
||||
if (event.keyCode === 13) // Enter
|
||||
{
|
||||
event.preventDefault();
|
||||
|
||||
if (document.getElementById('chore-form').checkValidity() === false) //There is at least one validation error
|
||||
if (!Grocy.FrontendHelpers.ValidateForm('chore-form'))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user