Mottie / Keyboard

Virtual Keyboard using jQuery ~
http://mottie.github.io/Keyboard/
Other
1.78k stars 723 forks source link

autocomplete jquery #512

Closed 0kkult0 closed 7 years ago

0kkult0 commented 7 years ago

jquery autocomplete in text input not work?

Mottie commented 7 years ago

Hi @0kkult0!

It works for me - demo.

0kkult0 commented 7 years ago

Hi, thi is my code

$('#txinput').keyboard({
        language: ['it'],
        keyBinding: 'mousedown touchstart',
        layout: 'qwerty',
        caretToEnd: true,
        autoAccept: true,
        usePreview: false,
        appendLocally: true,
        autoAcceptOnValid: true,
        container: { theme: 'b', cssClass: 'ui-body' },
        change: function (event, keyboard, el)
            {
                AttachAutocomplete();
            }

function AttachAutocomplete()
{
    $.ajax({
        type: "POST",
        url: "insauto.aspx/GetMarche",
        cache: false,
        contentType: "application/json;charset=UTF-8",
        data: "{'marca':'" + document.getElementById('txinput').value + "'}",
        dataType: "json",
        crossDomain: true,
        async: true,
        success: readstate,
        error: errorstate,
    });
}

function readstate(data, status) {
    if (data.d === "") { return; }

    var listall = data.d;

    $("#txinput").autocomplete({
        source: listall
    });
function errorstate(xmlRequest) { }

if I write from the physical keyboard works, but if I write on the virtual keyboard does not work

Mottie commented 7 years ago

Oh, you're not using the autocomplete extension?

Here is the documentation on how to set it up

I think I'll add a section on what scripts need to be loaded in the page header.

Mottie commented 7 years ago

Actually, the page head section is at the top of that setup page.

Mottie commented 7 years ago

I've moved the details for each extension into separate wiki pages. Here is the new autocomplete extension documentation.

Other than that, I'm guessing this issue has been resolved, so I'm going to close it. If you continue to have problems, please feel free to continue the discussion in this thread.