Submit on Enter

gatticlaudio

Claudio
Hello, in my forms I enabled the Submit on Enter option, and it works only by pressing the enter key twice.
What can be?
I use Fabrik version 3.9.10
Thank you.
 
Example : If your form id is 5
create form_5.js file in components/com_fabrik/js
and put this code
Code:
input.addEventListener("keyup", function(event) {
  event.preventDefault();
  if (event.keyCode === 13) {
    document.getElementById("fabrikSubmit_5").click();
  }
});
replace 5 with your form id
 
But the Submit on Enter option does not fulfill that function fairly?
In another way, for each form I will have to do the js ... !!!!!
 
Mahmoodee:
I made the js indicated and it didn't work ... it's like I ignored it.....
Sorry I copy the incorrect code from my website .
this is the correct one
Code:
jQuery(document).ready(function() {
  window.addEventListener("keyup", function(event) {
    event.preventDefault();
  if (event.keyCode === 13) {
    document.getElementById("fabrikSubmit_5").click();
  }
  })
});
 
mahmoodee
Now it worked.
This will involve me doing a js for each form wherever I want that functionality.
Now, I would like to know why the "Submit on Enter" option does not work ....
Thank you
 
Back
Top