Giter VIP home page Giter VIP logo

filterselect's Introduction

SelectFilter is a jQuery plugin for creating dependent select boxes where options are derived based on the value selected from other select element(s).

How to use it:

Link to jQuery library and the jQuery SelectFilter plugin's script

<script src="http://code.jquery.com/jquery.min.js"></script>
<script src="selectFilter.min.js"></script>

Create select boxes and uses HTML5 data attributes to configure the dependent select options.

<select data-target="secondList" class="firstList selectFilter">
	<option value="-1">Select</option>
	<option data-ref="one" >First One</option>
	<option data-ref="two" >First Two</option>
	<option data-ref="three">First Three</option>
</select>
<br />
<br />
<select data-target="thirdList" class="secondList selectFilter">
	<option value="-1">Select</option>
	<option data-ref="A" data-belong="one" >First One</option>
	<option data-ref="B" data-belong="two">First Two</option>
	<option data-ref="C" data-belong="three">First Three</option>
	<option data-ref="D" data-belong="one">Second One</option>
	<option data-ref="E" data-belong="two">Second Two</option>
	<option data-ref="F" data-belong="three">Second Three</option>
</select>
<br />
<br />
<select class="thirdList selectFilter">
	<option value="-1">Select</option>
	<option data-belong="A" >First One</option>
	<option data-belong="B">First Two</option>
	<option data-belong="C">First Three</option>
	<option data-belong="D">Second One</option>
	<option data-belong="E">Second Two</option>
	<option data-belong="F">Second Three</option>
	<option data-belong="A">Third One</option>
	<option data-belong="B">Third Two</option>
	<option data-belong="C">Third Three</option>

</select>

Note:

  • selectFilter is a class for select to enable selectFilter plugin.
  • data-target is use to target class of all select.
  • data-ref is use to refer the value to filter.
  • data-belong is use to filter the select by data-ref.

Check the website for more information.

filterselect's People

Contributors

sawankarn avatar

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.