Code Monkey home page Code Monkey logo

jquery.ui.combify's Introduction

jQuery UI Combify

Combify is a jQuery UI plugin that transforms any select input to a combo box where a user can enter values not present in the select list. It also includes autocomplete and key navigation support through the list with up/down arrows. Like many plugins, this was done for a specific project because I couldn't find anything that fit my requirements. I am putting it out here in the hopes that maybe someone else will also find it useful.

Dependencies

  • jQuery 1.7+
    
  • jQuery UI 1.8+
    

Setup and Usage

Add the CSS file to the HEAD tag

<link rel="stylesheet" type="text/css" href="jquery.ui.combify.css"

Load the JavaScript file in the HEAD tag

<script type="text/javascript" src="jquery.ui.combify.js"></script>

To use, simply call combify on a select input

<select id="SomeSelect"></select>
$("#SomeSelect").combify()

Options

###capitalizeInput

Automatically capitalizes all input as user types.

Default: false

Usage:

       $("#SomeSelect").combify({capitalizeInput: true})

###maxLength [n]

Locks the input field to a maximum length of [n] characters.

Default: false

Not specifying this option leaves the field as unrestricted

Usage:

       $("#SomeSelect").combify({maxLength: 10})

jquery.ui.combify's People

Contributors

hosamshahin avatar steelheaddigital avatar yarli avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

jquery.ui.combify's Issues

Needed to modify code to support value and text that differ

Hi Tom,

I wanted to let you know of a special case where I needed to modify the code for this plugin: the case where the displayed text and the underlying data value are different. We have several components where this is done; for example, a human-readable name is displayed but a more verbose ID used in the backend. I think I got the proper changes in the code so that it works ok with both our more complex use case as well as the more common simple list of strings. If you are interested, I can send you the altered code for your review. Then if you wish to roll it in as an enhancement you can, or you might find a better way to achieve the same thing since you know your own code better than I (and let me know what mistakes I might have made :-). Let me know if your interested. Thanx, /Mark

License?

I'm having trouble finding a license for this software... if one exists could you post it, and if not could you consider applying a very liberal open source license? A lot of jquery ui plugins opt for MIT....

dropdown search for utf-8 strings

Hi, combify is the only plugin which allows input text to be sent to server.
However searching of options does not work for utf-8 strings, (ex, japanese characters)
Can the filter function improved to accept non-latin characters.

Thanks

How do we attach event listeners?

I don't see a proper way to attach listeners in your README. I tried adding an onchange event to the hidden input ID, but the change event I add doesn't seem to get triggered. I also tried:

$(document).on('change', '#hidden_input_id', function() {alert("I CHANGED");});

But the change event is never fired. Suggestions?

Add method to change value

I use ajax in my project to select the option. Without combify, I can use this:
$('#myId').val(ajax_value);
With Combify, I need to use this:

$('#form-myId').val(ajax_value);
var innerOption = $('#form-myId').parent().parent().next().find('option[value='+ajax_value+']').text();
$('#CombifyInput-form-myId').val(innerOption);

It would be great to be able to use some official combify method for this instead of this hacky way.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.