The problem: this bug on IE is: if press enter key the test() function
execute two x.
keydown=true; // fake to enable blur on IE
function test(){ // for test input values
num=$('div span').length;
$('div').append('<span>the '+num+'test for input values...</
span>
');
}
$(document).ready(function(){ // DOM
$("input").bind("keydown", function(e){ // this a enter2tab function
if (e.keyCode == 13) { // if ENTER keycode
test() // exec function test input value
keydown=false; // fake to disable blur on IE
$(this).next().next().next().trigger("focus"); // to focus next
input after enter pressed
keydown=true; // fake to enable blur on IE
//console.log(e.type);
}
});
$("input").bind("blur", function(e){ // for blur strict
if(keydown==true){ // if fake blur is true
test() ; // exec function test input value
//console.log(e.type);
}
})
}) // end DOM
<form name="test" method="post">
<input name="aio"/><br /><br />
<input name="aio1"/><br /><br />
<input name="aio2"/><br /><br />
<input name="aio2"/><br /><br />
<input type="button" value="post form" />
</form>
How solve to if enter key, disable blur() ?