emposha / FCBKcomplete

Jquery facebook like(fancy) multi-select
http://www.emposha.com
383 stars 115 forks source link

func.call is not a function - when using oncall #99

Closed pufamuf closed 12 years ago

pufamuf commented 12 years ago

Hello, I seem to be receiving this error when using the oncall function. This is the error I get in firebug: func.call is not a function return func.call(func, _object);

Here is the code I'm using:

    <script type="text/javascript">
        $(document).ready(function(){                
            $("#select3").fcbkcomplete({
                json_url: "data.txt",
                addontab: true,                   
                maxitems: 10,
                input_min_size: 0,
                height: 10,
                cache: true,
                newel: false,
                filter_selected: true,
                maxitimes: 5,

    onselect:"getSelected", // <-----This is one thing I added                 
            });

            //second thing I added

            function getSelected() {
            var optionList;
            $("option", this).each(function () {
            optionList = $(this).val();
            });
           alert(optionList);
           }

           });
            </script>

Thanks everybody :)))

emposha commented 12 years ago

try it without quotes onselect:getSelected,