1

I'm using jquery for autocomplete and when the user select any item from the dropdown list , the cursor of the input text move to the left (begining of the input text).

The input text is not read only because I want to enable the user to enter text and not only select.

here is my code:

 $("#id").autocomplete({        
    source: url,
    select:  function (event, ui) {
               // some code here
    }
});

This behavior is not correct. I need that the cursor will stay at the end of the selected item and NOT move to the start.

Thanks for any help,

John.

1
  • 1
    So, you want to move the cursor to the beginning of your input? What is your question? Commented Sep 20, 2012 at 9:32

3 Answers 3

2

You can use this plugin to move the cursor on the select event https://gist.github.com/1007907

Sign up to request clarification or add additional context in comments.

Comments

1

I don't have this behaviour. Here is a fiddle to explain how I have tested : http://jsfiddle.net/S77xa/62/

Comments

0

this is usually a problem when you have not focused the element before. Try to use

$("#id").focus(); 

on select.

1 Comment

didn't help. I have also tried to add autoFocus: true to the autocomplete also didn't help.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.