For the combox ultimate page prototype, refer to dojo, which has better functions and less code than those of jquery on the Internet.

Source: Internet
Author: User

Introduction
Minimal js implementation of the combox Function Code For the page prototype, refer to the combox format of dojo. It supports keyboard operations, automatic filtering, and highlighting.

API
Initialization Method
Encoding Method
VaR c = new combox (document. getelementbyid ('A '));
Or
VaR c = new combox (document. getelementbyid ('A'), {Debug: true });
CSS declaration method

<Select class = "combox" DEBUG = "true">
As long as the class contains combox, other styles can be included in the class. For example

<Select class = "ABC combox Def">
Or

Configuration parameter description
Combox supports the following configuration parameters:

Debug: True/false, whether the original select element is visible
Searchmode: 0 is case-insensitive, and 1 is prefix. Search is case-insensitive.
Remotesourceurl: Remote Data source URL, which can be in the following JSON format
[
{"Text": "A", "value": "B" },{ "text": "A1", "value": "B1 "}
]
Remotefilterurl: the remote URL read during filtering. The parameter is XXXX? Asdasd = ~! Value !~,~! Value !~ Macro. It is replaced with the value of the current input box when triggered.
Allowanyvalue: The default value is false. combox cannot input data in non-Options.
Displayvalue: The displayed value of combox. When displayvalue can be found in combox options, it displays the text of this option; otherwise, displayvalue is displayed.
Pleaseselect: When the txtbox value of combox is pleaseselect text, all options are displayed in the drop-down list.
Mousedblclick: 0 indicates a click, and 1 indicates a double-click.
Example:

VaR c = new combox (document. getelementbyid ('A '),{
Allowanyvalue: True,
Pleasselect: 'Please select ',
Debug: true })
Or
<Select class = "combox" allowanyvalue = "true" pleasselect = "select" DEBUG = "true">
Or

Google Code address of the project

Http://code.google.com/p/enhancehtml/

Effect

Demo address http://demo.jb51.net/js/combox/demo.htm
Http://jb51.net/jiaoben/25840.html

Related Article

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.