Pflichtenheftdetails: bei RETURN per AJAX speichern
[kivitendo-erp.git] / templates / webpages / requirement_spec / _form.html
index 800bb15..3260263 100644 (file)
   [% L.submit_tag("action_" _ (SELF.requirement_spec.id ? "update" : "create"), LxERP.t8('Save'), id=id_prefix _ '_action_update') %]
   <a href="[% SELF.url_for(action="list", is_template=SELF.requirement_spec.is_template) %]">[% LxERP.t8('Abort') %]</a>
 [% ELSE %]
-  [% L.ajax_submit_tag("controller.pl?action=RequirementSpec/update",  "#" _ id_prefix, LxERP.t8("Save")) %]
+  [% L.ajax_submit_tag("controller.pl?action=RequirementSpec/update",  "#" _ id_prefix, LxERP.t8("Save"), id=id_prefix _ '_submit') %]
+  <script type="text/javascript"><!--
+  $(function() {
+    $("#[% id_prefix %] INPUT[type=text]").keydown(function(event) {
+      if(event.keyCode == 13) {
+        event.preventDefault();
+        $('#[% id_prefix %]_submit').click();
+        return false;
+      }
+    });
+  });
+--></script>
 [% END %]
  </p>
 </form>