I would like to type something into my textbox and then press ENTER, it will execute a function. I tried onFocus, onChange and onBlur but it doesn't do what I want it to. Here's an example I use for onChange. Application: <input type="text" onchange="execProg(0);"> Code (markup): Any comments or suggestions is greatly
use the onkeydown or onkeyup events. There you can call a function which will check what key was pressed with and then execute the code you want. if(event.keyCode == 13) { // put you code here... keyCode for Enter is 13 ;) } Code (markup):
If you want to be executed on enter, then i think you should change it to: Application: <input type="text" onsubmit="execProg(0);"> <input type=submit value="Submit"> Code (markup):