File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -1379,7 +1379,17 @@ var plugin_formcreator = new function() {
1379
1379
return ;
1380
1380
}
1381
1381
} ) ;
1382
- }
1382
+ } ;
1383
+
1384
+ this . submitUserForm = function ( event ) {
1385
+ var keyPressed = event . keyCode || event . which ;
1386
+ if ( keyPressed === 13 && $ ( '[name="submit_formcreator"]' ) . is ( ':hidden' ) ) {
1387
+ event . preventDefault ( ) ;
1388
+ return false ;
1389
+ }
1390
+
1391
+ return true ;
1392
+ } ;
1383
1393
}
1384
1394
1385
1395
// === TARGETS ===
Original file line number Diff line number Diff line change 45
45
46
46
<div class =" asset" >
47
47
{% set formName = ' plugin_formcreator_form' %}
48
- <form name =" {{ formName }}" method =" post" role =" form" enctype =" multipart/form-data" class =" plugin_formcreator_form" action ={{ item.getFormURL () }} id =" plugin_formcreator_form" data-itemtype =" PluginFormcreatorForm" data-id =" {{ item .fields ['id' ] }}" >
48
+ <form name =" {{ formName }}" method =" post" role =" form" enctype =" multipart/form-data" class =" plugin_formcreator_form" action ={{ item.getFormURL () }} onkeypress = " return plugin_formcreator.submitUserForm(event); " id =" plugin_formcreator_form" data-itemtype =" PluginFormcreatorForm" data-id =" {{ item .fields ['id' ] }}" >
49
49
<h1 class =' form-title' >
50
50
{{ __(item .fields ['name' ], options .domain ) }}
51
51
<i class =" fas fa-print" style =" cursor: pointer;" onclick =" window.print();" ></i >
You can’t perform that action at this time.
0 commit comments