Submit to Keypad - Intel XDK

Asked

Viewed 44 times

-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.

  • Opa @Lucas Costa, cara Acessei the site by the device but it did not activate the keyboard. I’m leaving to do something?

  • 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.

  • I located another site for the same purpose, gave Keycode 13 (enter)

  • I was able to solve it. But after executing the function (in the example Alert) it is still resetting the application. ?

  • Above the Alert, try to put preventDefault. Would look like this: $('ins_prod').on('submit', function(ev){ ev.preventDefault(); 
 alert("oi");
 });

  • 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.

Show 2 more comments

1 answer

1

Solved: The input was inside a form. I removed and the error of resetting the app stopped. Vlw by force.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.