/ Published in: jQuery
13 is Enter key return false cancels the postback
In this case I am calling the javascript doPostBack and telling it to execute the txtBoxTextChanged method brief tutorial on doPostBack here: http://aspalliance.com/895UnderstandingtheJavaScript___doPostBackFunction.all
Expand |
Embed | Plain Text
//prevent page submit on enter key press //call the postback javascript then cancel the enter key press $(document).keydown(function (e) { if (e.keyCode == 13) { __doPostBack('txtBox_TextChanged', ''); return false; } });
You need to login to post a comment.
