Skip to content

Jihoon-Kong/autoComplete.js

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

autoComplete.js

AutoComplete is a jQuery Mobile plugin which allows developers to add autoComplete search boxes to your project.

Based on the blog entry of Raymond Camden (@cfjedimaster).

Example

View a simple demo of autoComplete

Quick start

Clone the git repo - git clone git@github.com:commadelimited/autoComplete.js.git - or download it

Usage & Documentation

$("#searchField").autocomplete({
	target: $('#suggestions'), // the listview to receive results
	source: 'data.cfc?method=search&returnformat=json', // URL return JSON data
	link: 'testing.cfm?term=', // link to be attached to each result
	minLength: 0 // minimum length of search string
});

AutoComplete.js can read data in one of two ways: simple or complex. Simple data should be returned from the source in the following format:

[
	"Maine",
	"Maryland",
	"Massachusetts"
]

Causing the resulting code to look like this: <a href="testing.cfm?term=Maine">Maine</a>

Complex data allows the developer to specify which value goes where. AutoComplete.js requires data to be returned in a specific format:

[
	{
		value: "22",
		label: "Maine"
	},
	{
		value: "23",
		label: "Maryland"
	},
	{
		value: "24",
		label: "Massachusetts"
	}
]

Causing the resulting code to look like this: <a href="testing.cfm?term=22">Maine</a>

Contributing

You are invited to contribute code and suggestions to this project. The more the merrier.

Project Info

3rd party libraries required:

  • jQuery: MIT/GPL license
  • jQuery Mobile: MIT/GPL license

Custom bits:

Public domain

About

A jQuery Mobile autocomplete plugin

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors