$("#myinputfield").focus();
Doing that on an input field with it's value already set causes the current value to be selected. How can I focus the field without selecting the text?
$("#myinputfield").focus();
Doing that on an input field with it's value already set causes the current value to be selected. How can I focus the field without selecting the text?
I've searched around a bit and kinda found out that you should re-set your value into the desired field after it is focussed on.
How about something like this where you set the value of the input field to itself after focusing it?
$("#myinputfield").focus().val($("#myinputfield").val());
Have you tried this?
var txt = $("#myinputfield").val();
$("#myinputfield").focus();
$("#myinputfield").val( txt );