0

I am created a demo of autocomplete using http://jqueryui.com/demos/autocomplete/ plugin. Now the suggested list which appears on pressing key is

<ul>
    <li>
          Suggestion
    </li>
  </ul>

I have to edit the list like :

<ul>
    <li>
           <a>Suggestion</a>
          <br />
        <a>data1</a><a>data2</a>
    </li>

   </ul>

how can I do this? I seen script for autocomplete but not found any hint.

2 Answers 2

0

You can configure the autocomplete with the formatItem, and the parse properties of the configuration object.

This question has been answered here: JQuery AutoComplete results format?

Sign up to request clarification or add additional context in comments.

Comments

0

Looks like you want to add some HTML to the result. If that is correct, the jquery ui docs point to a resource (at the bottom of the docs page):

The label is always treated as text, if you want the label to be treated as html you can use Scott González' html extension. The demos all focus on different variations of the source-option - look for the one that matches your use case, and take a look at the code.

Or, you can add custom data using the open event of the autocomplete. See example here:

http://www.jensbits.com/2011/03/03/jquery-autocomplete-with-html-in-dropdown-selection-menu/

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.