Explorar el Código

20250423 屏蔽回车键

贾小兵 hace 5 días
padre
commit
355aeb7daf

+ 7 - 0
public/assets/js/backend/teacher/collection.js

@@ -355,6 +355,13 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
         },
         api: {
             bindevent1: function () {
+                //屏蔽回车键
+                $(window).keydown( function(e) {
+                    var key = window.event?e.keyCode:e.which;
+                    if(key.toString() == "13"){
+                        return false;
+                    }
+                });
                 Form.api.bindevent($("form[role=form]"));
             },
             initSubTable: function (index, row, $detail,parent_table) {

+ 7 - 0
public/assets/js/backend/teacher/practice.js

@@ -432,6 +432,13 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form','editable'], function
         },
         api: {
             bindevent1: function () {
+                //屏蔽回车键
+                $(window).keydown( function(e) {
+                    var key = window.event?e.keyCode:e.which;
+                    if(key.toString() == "13"){
+                        return false;
+                    }
+                });
                 Form.api.bindevent($("form[role=form]"));
             },
             initSubTable: function (index, row, $detail,parent_table) {