Hmm it remoevs what I put bwtween [] from the title?
Anyway, the title were supposed to be [autocomplete]Is it possible to
get the array it is working on?

On Mar 14, 10:55 am, Jonas <jonas.sjob...@gmail.com> wrote:
> Or maybe this can be done ina  nicer way, let me explain what i want
> to do
>
> When you enter something in the field and it matches with one of the
> items in the list I want to change the style of the field to bold. I
> tried this
>
> $("#name").result(function(event, data, formatted) {
>   $('#name').css({fontWeight: 'bold'});
>
> });
>
> But it has 2 drawbacks:
> 1. It is only executed if I select the item form the autocompletelist,
> not if the user simply writes exactly the right thing.
> 2. If they select the item and the field gets bold as it should and
> they THEN remove a letter or write more so it no longer matches I want
> to change it back.
>
> Unless there's built in functionality for this the solution I had in
> mind was:
> $("#name").keydown( function(event) {
>   if($("#name").val() in thearray)
>   {
>     make bold
>   }
>   else
>   {
>     make unbold
>   }
>
> }
>
> but then I need a way to fetch the array.

Reply via email to