Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

jQuery plugin to create a text box which can auto-complete and pull-down-select.

NotificationsYou must be signed in to change notification settings

sutara79/jquery.ajax-combobox

Repository files navigation

npm versionBuild Status

jQuery plugin to create a text box which can auto-complete and pull-down-select.

image

Demo

https://sutara79-php.herokuapp.com/demo/jquery.ajax-combobox/

Install

Usage

HTML
<linkrel="stylesheet"href="jquery.ajax-combobox.css"><inputtype="text"id="foo"><scriptsrc="https://code.jquery.com/jquery-3.2.1.min.js"></script><scriptsrc="jquery.ajax-combobox.min.js"></script>
JavaScript
$('#foo').ajaxComboBox('jquery.ajax-combobox.php');

Note

Database

Change the value to connect DB indist/php/jquery.ajax-combobox.php

<?php//++++++++++++++++++++++++++++++++++++++++++++++++++++//#### You MUST change this value. ####$mysql =array('dsn'      =>'mysql:host=localhost;dbname=acbox;charset=utf8','username' =>'root','password' =>'');$sqlite =array('dsn'      =>'sqlite:../sample/sample.sqlite3','username' =>'','password' =>'');newAjaxComboBox($sqlite);//++++++++++++++++++++++++++++++++++++++++++++++++++++?>

Options

  • 1st arg (string|Object): Server side file such as PHP. Or an object of data
  • 2nd arg (Object): Options
Combobox
OptionTypeInitialExplain
langstring'en'Language for this plugin's UI (en, es, pt-br and ja)
db_tablestring'tbl'Table of database to query
fieldstring'name'Field of table to display on result
search_fieldstring=fieldField of table to search. Accept comma separated string. (e.g.:'id, name, job')
order_bymixed=search_fieldField for sorting (e.g.'name DESC',['name ASC', 'age DESC']).
ASC orDESC should be UPPERCASE.
and_orstring'AND'Boolean searching ('AND', 'OR')
per_pagenumber10Amount of items per page
navi_numnumber5Amount of page-link on navi
navi_simplebooleanfalseEnable simple navi to narrow as possible
plugin_typestring'combobox'Choose 'combobox','simple','textarea'
bind_tostringnullEvent to run after selecting
button_imgstringOcticonsImage for "Get All" button. Accept HTML element, src attribute
Sub-info
OptionTypeInitialExplain
sub_infomixedfalseDisplay sub-info (true, false, 'simple')
sub_asObject{}Alias for fields of sub-info
show_fieldstringnullField to display on sub-info. Accept comma separated. ('id, job, age')
hide_fieldstringnullField to hide on sub-info. Accept comma separated. ('id, job, age')
Select-only
OptionTypeInitialExplain
select_onlybooleanfalseForce only selecting
primary_keystring'id'Primary-key to use "select only" mode
init_recordnumbernullValue of primary-key for initial value
instancebooleanfalseReturn instance instead of jQuery object
Textarea
OptionTypeInitialExplain
tagsArraynullOptions for searching tags
tags.patternArraynullA pair of start symbol and end symbol to surround a tag
tags.spaceArray[true, true]Insert space automatically ahead start symbol and behind end symbol
tags.db_tablestring=db_table
tags.fieldstring=field
tags.search_fieldstring=search_field
tags.order_bymixed=order_by
tags.sub_infomixed=sub_info
tags.sub_asObject=sub_as
tags.show_fieldstring=show_field
tags.hide_fieldstring=hide_field
Shorten URL
OptionTypeInitialExplain
shorten_btnstringnullCSS selector of the button to shoten url
shorten_srcstring'dist/bitly.php'Path to the script to shorten url
shorten_minnumber20Minimum characters to run shortening url
shorten_regObjectnullRegExp object to detect url in the textarea

Extensions

Forked

License

MIT

Author

Yuusaku Miyazaki(toumin.m7@gmail.com )

About

jQuery plugin to create a text box which can auto-complete and pull-down-select.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp