-3
For example, I fill in the input of this fiddle with "Ste" and then go back to the beginning of the input to type "te" before "Ste", it goes to the end of the input when I type the first character "t". That is, whenever I type a character and the cursor is not at the end, the cursor goes to the end of the input after I type the character.
This is the script I’m using. I saw somewhere that setting this.selectionEnd would work but it didn’t work.
$('body').on('input propertychange', '#form_cliente_id', function (e) {
var position = this.selectionStart;
e.preventDefault();
$('#form_cliente_id').submit();
this.selectionEnd = position;
});
Any hint as to why this is happening and how to resolve?
Thank you!
#form_cliente_id is the form id. The original code is enabled when something is changed in any form input. In the example of the question does not make much difference, but in the real case there are several inputs. Also, the problem has not been fixed in your fiddle. But eventually I discovered the solution
– Claudio Shigueo Watanabe