locked
Access items in typehead Jquery RRS feed

  • Question

  • User1259588416 posted

    Hi guys,

    I have implemented a typhead in text box in mvc application.

    One typing in text box items drop down , Now I want to call javascript function on clicking items.
    Kindly help how to implement this ?

    Tuesday, October 6, 2015 9:22 PM

Answers

  • User1724605321 posted

    Hi kaushiklotus,

    I have implemented a typhead in text box in mvc application.

    How you implemented a typehead in text box ? If you are using jquery autocomplete .When autocomplete changes a value, it fires a autocompletechange event :

    $(document).ready(function () {
        $('#tags').on('autocompletechange change', function () {
            $('#tagsname').html('You selected: ' + this.value);
        }).change();
    });

    Please refer to link below for details and demo:

    http://stackoverflow.com/questions/19675069/how-to-get-value-of-selected-item-in-autocomplete .

    Best Regards,

    Nan Yu

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, October 7, 2015 1:45 AM