Fix double form submit when using ENTER (fixes #72)

This commit is contained in:
Bernd Bestel
2018-09-29 13:41:56 +02:00
parent d7180bd7b2
commit bb5fd8360b
35 changed files with 52 additions and 35 deletions

View File

@@ -39,9 +39,10 @@ $('#quantityunit-form input').keydown(function(event)
{
if (event.keyCode === 13) //Enter
{
event.preventDefault();
if (document.getElementById('quantityunit-form').checkValidity() === false) //There is at least one validation error
{
event.preventDefault();
return false;
}
else