diff --git a/BudgetMasterServer/src/main/resources/static/js/transactions.js b/BudgetMasterServer/src/main/resources/static/js/transactions.js
index 2d4f4071486ecc8a73a3baffc29200868173b196..46d68433388ffcbbb2c5ea36922d89d1b118761d 100644
--- a/BudgetMasterServer/src/main/resources/static/js/transactions.js
+++ b/BudgetMasterServer/src/main/resources/static/js/transactions.js
@@ -524,19 +524,21 @@ function openKeywordWarningModal(htmlData)
     {
         $(modalID).modal('close');
 
+        let allowEmptyAmount = document.getElementById('template-name') !== null;
+
         // rebind onsubmit function to skip keyword check once
-        document.getElementsByName('NewTransaction')[0].onsubmit = function()
+        document.getElementById('mainForm').onsubmit = function()
         {
-            return validateForm(false, true);
+            return validateForm(allowEmptyAmount, true);
         };
 
         // TODO differentiate between user clicked button "save" or "save and continue" before
         document.getElementById('button-save-transaction').click();
 
         // reset onsubmit function in case user edits transaction name too after fixing validation errors
-        document.getElementsByName('NewTransaction')[0].onsubmit = function()
+        document.getElementById('mainForm').onsubmit = function()
         {
-            return validateForm(false, false);
+            return validateForm(allowEmptyAmount, false);
         };
     });
 }
diff --git a/BudgetMasterServer/src/main/resources/templates/templates/newTemplate.ftl b/BudgetMasterServer/src/main/resources/templates/templates/newTemplate.ftl
index 853a81a73b5d15eb69ed0296c7b46b075e7d4650..c0d5c73e2763eb5b37a517bca2b040fe0c3b5671 100644
--- a/BudgetMasterServer/src/main/resources/templates/templates/newTemplate.ftl
+++ b/BudgetMasterServer/src/main/resources/templates/templates/newTemplate.ftl
@@ -36,7 +36,7 @@
                 <@header.content>
                     <div class="container">
                     <#import "../helpers/validation.ftl" as validation>
-                    <form name="NewTemplate" action="<@s.url '/templates/newTemplate'/>" method="post" onsubmit="return validateForm(true)">
+                    <form id="mainForm" name="NewTemplate" action="<@s.url '/templates/newTemplate'/>" method="post" onsubmit="return validateForm(true)">
                         <input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
                         <input type="hidden" name="ID" value="<#if template.getID()??>${template.getID()?c}</#if>">
                         <input type="hidden" name="templateGroup" value="<#if template.getTemplateGroup()??>${template.getTemplateGroup().getID()?c}</#if>">
@@ -89,6 +89,8 @@
                         <#-- buttons -->
                         <@newTransactionMacros.buttons cancelURL="/templates" includeContinueButton=false/>
                     </form>
+
+                    <div id="transactionNameKeywordWarningModalContainer"></div>
                 </div>
                 </@header.content>
             </div>
diff --git a/BudgetMasterServer/src/main/resources/templates/transactions/newTransactionNormal.ftl b/BudgetMasterServer/src/main/resources/templates/transactions/newTransactionNormal.ftl
index a55e6a07410eccfaf01f1114a4a36beb85d104ed..cf77495d3a8720a20308e7b1e8393646d559e06e 100644
--- a/BudgetMasterServer/src/main/resources/templates/transactions/newTransactionNormal.ftl
+++ b/BudgetMasterServer/src/main/resources/templates/transactions/newTransactionNormal.ftl
@@ -33,7 +33,7 @@
                 <@header.content>
                     <div class="container">
                         <#import "../helpers/validation.ftl" as validation>
-                        <form name="NewTransaction" action="<@s.url '/transactions/newTransaction'/>" method="post" onsubmit="return validateForm()">
+                        <form id="mainForm" name="NewTransaction" action="<@s.url '/transactions/newTransaction'/>" method="post" onsubmit="return validateForm()">
                             <input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
                             <!-- only set ID for transactions not templates, otherwise the input is filled with the template ID and saving the transaction
                             may then override an existing transactions if the ID is also already used in transactions table -->
diff --git a/BudgetMasterServer/src/main/resources/templates/transactions/newTransactionTransfer.ftl b/BudgetMasterServer/src/main/resources/templates/transactions/newTransactionTransfer.ftl
index 73a7426f173ba48bc033168769a024626388a6ca..6c9560c743d4c232ec15820f8d60a0b25b623784 100644
--- a/BudgetMasterServer/src/main/resources/templates/transactions/newTransactionTransfer.ftl
+++ b/BudgetMasterServer/src/main/resources/templates/transactions/newTransactionTransfer.ftl
@@ -33,7 +33,7 @@
                 <@header.content>
                     <div class="container">
                         <#import "../helpers/validation.ftl" as validation>
-                        <form name="NewTransaction" action="<@s.url '/transactions/newTransaction'/>" method="post" onsubmit="return validateForm()">
+                        <form id="mainForm" name="NewTransaction" action="<@s.url '/transactions/newTransaction'/>" method="post" onsubmit="return validateForm()">
                             <input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
                             <!-- only set ID for transactions not templates, otherwise the input is filled with the template ID and saving the transaction
                             may then override an existing transactions if the ID is also already used in transactions table -->