jquery autocomplete: works for first value, how to enable it for next?

Posted by Toni Michel Caubet on Stack Overflow See other posts from Stack Overflow or by Toni Michel Caubet
Published on 2010-12-21T00:29:53Z Indexed on 2010/12/23 18:54 UTC
Read the original article Hit count: 237

hello there!

I'm using autocomplete so user can easly enter data on inputs, like this:

 <?
$a = new etiqueta(0, '');
$b = $a->autocomplete_etiquetas();
?>
<script type="text/javascript">
    function cargar_autocomplete_etiquetas(){
        $("#tags").autocomplete({
            source: [<? echo $b; ?>]
        });
    }
</script>

$a = $b its an array with a result like: 'help','please',i','need','to,'be able to', 'select next item',' with autocomplete';

and i checked the ui documentation, but it doesn't fith with my source method.. any idea? I'm trying like this (edited with Bugai13 aportation):

 <?
$a = new etiqueta(0, '');
$b = $a->autocomplete_etiquetas();
?>
<script type="text/javascript">
    function cargar_autocomplete_etiquetas(){
    $("#tags").autocomplete({
        source: [<? echo $b; ?>],
        multiple: true,
        multipleSeparator: ", ",
        matchContains: true
    });
}

</script>

but i don't know how to do it.. any idea? are .push and .pop functions from the autocomplete? or shall i define, them?

thanks again!

PS: i'm getting adicted to this site! PS: come on dudes, i think the answer will be very usefull for many people PS: is it allowed to offer paypal reward?

© Stack Overflow or respective owner

Related posts about jquery-ui

Related posts about select