On Feb 1, 3:50 pm, "jim" <jimmorga...@gmail.com> wrote:
> Hi,
>
> I have a form that accepts free text from users in a single textarea
> field. I would like for a select list of words (15 or so) to
> autopopulate as the user types. For example, instead of typing
> "customer" the user could type "cu" and the form finish it for him/
> her.
>
> I know how to set autocomplete for a single text field, but don't know
> if it's possible to have a field autocomplete partway through (e.g. if
> the first word here is "customer" then we're set, but if the sentence
> is "gave a coupon to customer X" then autocomplete wouldn't work).
>
> Is this possible? If so, can anyone point me toward a script?
>
> Thanks.
>
> jim
Hi Jim.
Yes it's possible, but I believe it's far from simple, as you would
need to create a class to handle it, and create custom methods for
your textarea. I was trying to acheive the same thing a few months
ago, and unfortunately, despite my efforts, I was unable to find a
script to do what I needed.
I think it would benefit you to take a look at Google Mail, and the
way it does it's spell checking, and also
www.google.com/webhp?complete=1
which is Google Suggest. It uses a text input field instead of a
textarea, but you might be able to get some inspiration from it.
Good luck.
Daz.