I am building a bunch of controls dynamically.
Essentially I am attaching a keyup to the textbox to detect when up/down is pressed in a table to move between cells. I am a开发者_开发知识库lso watching for when the input field changes, because I then add that control to an array for posting back when the user hits save.
This works when I tab between controls or click from one control to the next. However, If I use the arrow keys as coded to move between fields, the change event does not fire.
My event handling code looks like this:
$('input[id^="reo_"]').bind('change', function () {
rowDetailChange($(this));
});
$('input[id^="reo_"]').bind('keyup', function (e) {
processKeyUp($(this), e);
});
The change event fires upon focus out, blur and enter with the condition that the content has been altered. This is because the event would fire a great lot elsewise.
精彩评论