BootStrap Intelligent Form Combat Series (10) automatic completion of component support _javascript tips

Source: Internet
Author: User

Web development, must encounter like Baidu, Google this kind of search function, that intelligent form of automatic completion can do, the following to reveal:

1, including such as Google, Baidu and other similar simple search

2, the complex structure of support, such as the input product number, the product needs to be the number, product name, product price, product information, such as the note will fill out a place in the form

The code is as follows (page address: https://github.com/xiexingen/Bootstrap-SmartForm/blob/master/demo/form3-ele-autocomplete.html):

Automatic completion

Note: Need to introduce JS file: Jquery-ui.js, Jquery.fn.extend.js

Call the Smartsearch method by specifying the element after form generation completes

Parameter description:

URL: Requested URL

Beforesearch: Optional, the method that is called before sending the request, the method has a parameter data contains to send, if need to add or modify the parameters to send, modify the second parameter can

Formatitem: Optional, if the return is not a simple array string, then a custom action will be used to format the contents of the interface, shown in the example of the product number + product Name

Callback: Optional, if the return is not a simple array string, then the custom action will be used to assign the value
Note: If the interface returns a simple array of strings, both Formatitem and callback can be omitted

This is a screenshot of my local test project that runs:

The above is a small set to introduce the bootstrap intelligent form of the actual Combat series (10) automatically complete the support of the components of all the narrative, I hope to help you, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.