function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
doravmondoravmon 

Deselect inputText field after focus on..

Hi everyone, I have a question here:
in my apex page, I have a search field, user can serch for sth dynamiclly by typing. Here is the two code I use:
<apex:inputText id="inputField" value="{!serchFieldValue}" onchange="!myFunction">
<apex:actionFunction name="myFunction" action="{!getResult}" focus = "inputField"/>

After do the action, I want it focus back on the input field, but not select the input already there.....User-added image  
the focus should on the place after b.......... any ideas ?~
Best Answer chosen by doravmon
bob_buzzardbob_buzzard
There's a really good article at : http://codetheory.in/javascript-control-input-field-caret-position-or-move-to-end-in-textboxes-and-textareas/