The problem is : an infinite call to the function , it's like and infinite loop.
i ve changed the whole code structure. And i ve arrived to the solution without getting any error.
This code will give the same behavior of the tab button to the enter button. plus it will focus just on text and textareas.
$(document).on('keydown', 'input[type="text"],textarea', function(e) {
var key = e.charCode ? e.charCode : e.keyCode ? e.keyCode : 0;
if(key === 13) {
e.preventDefault();
$(this).focus();
var inputs = $(this).parents('body').find(':input[type="text"]:enabled:visible:not("disabled"),textarea');
inputs.eq( inputs.index(this)+ 1 ).focus();
inputs.eq( inputs.index(this)+ 1 ).click();
e.preventDefault();
e.stopPropagation();
}
}