Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8250481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T23:54:20+00:00 2026-06-07T23:54:20+00:00

Here is my function i wrote for getting usernames, location, and their pictures. Now

  • 0

Here is my function i wrote for getting usernames, location, and their pictures. Now the problem is if I use mustMatch option with it, every thing is working fine except for one bug. If lets say i type S it bring ‘Sebastian’ ‘einstain’. If i select sebastian everything works like charm but if i select einstain it erases everything.

I tried to use change: event but its not firing in any case dont know why

$(document).ready(function(){

  var wp_v = '3';

  $("#searchbox").autocomplete("search.php?wp="+wp_v, {

    matchContains: true,
    //mustMatch: true,
    width: 258,
    scroll: true,
    scrollHeight: 350,
    dataType: 'json',
    change: function (event, ui) {
      alert('change');
      if (!ui.item) {
        $(this).val('');
      }
    },
    parse: function(data) {
      var array = new Array();
      for (var i = 0; i < data.length; i++) {
        array[array.length] = {
          data: data[i],
          value: data[i].name,
          result: data[i].name
        };
      }
      return array;
    },
    formatItem: function(row) {                     
      var output =  "<img class=img src='avatars/" + row.img + "'/> ";             
      output += "<span class=name>"+row.name+"</span><br/>";
      output += "<span class=small>"+row.country+"</span><br/>";
      return output;
    }

  }).result(function(event,item) {

    if (item == undefined) {
      $('#receiver').val('');
    } else {
      $('#receiver').val(item.uid);
    }

  });

});

This is the source

[
  {"uid":"2","name":"Sebastian Aparicio","img":"1339875067-Koala.jpeg","country":"Leder"},
  {"uid":"12","name":"Mester Jakob","img":"default.jpeg","country":"Salg"},
  {"uid":"19","name":"Mester Jakob","img":"1339875047-Penguins.jpeg","country":"Leder"}
]
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T23:54:21+00:00Added an answer on June 7, 2026 at 11:54 pm

    Actually autocomplete plugin version was different. That’s why it was not working.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is a function I wrote to break a long string into lines not
I wrote the function using js+jQuery. Here is a link to a jsFiddle which
everyone. Here is a small VBA (Excel) function that i wrote, full of MsgBoxes
I'm trying to use a function with PostgreSQL to save some data. Here is
When I load my page I'm getting this error: Fatal error: Can't use function
It is valid JavaScript to write something like this: function example(x) { Here is
I have two functions here function Preloader() {} Preloader.prototype = { init:function() { //
I have a simple Jquery function here: function submit_selection(del,submit) { del='yes'; submit=true; var ITAMZ=new
Here is function , <script type=text/javascript> $(document).ready(function() { getRecordspage(1, 5); $(a.page-numbers).click(function() { alert(1); getRecordspage($(this).text(),
$('#selector').click(function() { // here I would like to load a javascript file // let's

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.