-1
Hello. I’m having a hard time using Submit in a numerical input on the Intel XDK. I want you to click on "GO/IR", run a function.
In the JS is like this:
$('ins_prod').on('submit', function(){
alert("oi");
});
Only when executing it resets the application.
You can get what the key code is when you click "GO/IR" here. If you could share with us, it would help.
– BrTkCa
Opa @Lucas Costa, cara Acessei the site by the device but it did not activate the keyboard. I’m leaving to do something?
– MarcelP
I can’t say, I don’t know Intel XDK, my guess was that this key could be being recognized with a different key code.
– BrTkCa
I located another site for the same purpose, gave Keycode 13 (enter)
– MarcelP
I was able to solve it. But after executing the function (in the example Alert) it is still resetting the application. ?
– MarcelP
Above the Alert, try to put
preventDefault
. Would look like this:$('ins_prod').on('submit', function(ev){ ev.preventDefault(); 
 alert("oi");
 });
– BrTkCa
my code looked like this:
$('#ins_prod').on('keydown',function(i){
 if (i.keyCode == 13){
 i.preventDefaut();
 alert("oi");
 }
});
, however, after executing the alert, reset the app.– MarcelP