0

I am trying to autocomplete a text field to enter recipes into a form. For example, a user inputs "2 Cups" into the textbox. When she hits the "c" it autofills with the word "Cup(s)". I got that part. But I need the word "Cup(s)" to be highlighted, so if it not what the user is looking for they can just keep typing and overwrite it.

Any ideas? I'd like to use jQuery but JavaScript is awesome too.

Thanks for any help.

wibberding
  • 815
  • 3
  • 10
  • 17
  • are you sure you want "Cup(s)" to be highlighted, and not just "up(s)" (the part that was autocompleted)? Otherwise they'd be typing over the last character they typed. – Josh from Qaribou May 11 '14 at 23:58
  • take a look at this: http://stackoverflow.com/questions/3085446/selecting-part-of-string-inside-an-input-box-with-jquery – alex May 12 '14 at 00:00
  • You are correct. Good point. Will take a look. – wibberding May 12 '14 at 00:09

0 Answers0