Giter VIP home page Giter VIP logo

limitcheckbox's Introduction

Introdução

JQuery.limitcheckbox é um plugin que limita a seleção de inputs do tipo checkbox.

O desenvolvi, a princípio, para testar a criação de plugin utilizando a jQuery Boilerplate.

Como Usar

  • Ter os checkbox em um container (pode usar o body como tal).
  • Invocar o plugin neste container, especificando o limite ao invocar o plugin ou usando o atributo data-limit-checkbox no container.
  • O limite especificado pelo atributo data-limit-checkbox sobrepõe a opção indicada ao instanciar o plugin.

Exemplos

<fieldset class="limitcheckbox">
    <legend>Escolha as opções:</legend>
    <p><input type="checkbox" id="01" /><label for="01">Texto 01</label></p>
    <p><input type="checkbox" id="02" /><label for="02">Texto 02</label></p>
    <p><input type="checkbox" id="03" /><label for="03">Texto 03</label></p>
    <p><input type="checkbox" id="04" /><label for="04">Texto 04</label></p>
    <p><input type="checkbox" id="05" /><label for="05">Texto 05</label></p>
</fieldset>

<fieldset class="limitcheckbox" data-limit-checkbox="3">
    <legend>Escolha as opções:</legend>
    <p><input type="checkbox" id="11" /><label for="11">Texto 11</label></p>
    <p><input type="checkbox" id="12" /><label for="12">Texto 12</label></p>
    <p><input type="checkbox" id="13" /><label for="13">Texto 13</label></p>
    <p><input type="checkbox" id="14" /><label for="14">Texto 14</label></p>
    <p><input type="checkbox" id="15" /><label for="15">Texto 15</label></p>
</fieldset>
$(".limitcheckbox").limitcheckbox(2);

O primeiro bloco permitirá selecionar até 2 checkbox, enquanto o segundo bloco permitirá a seleção de até 3 checkbox

limitcheckbox's People

Contributors

brunogasparetto avatar

Watchers

 avatar  avatar  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.