Code Monkey home page Code Monkey logo

custom-radio-checkbox's People

Contributors

cstickel avatar dciccale avatar f-reinhart avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

custom-radio-checkbox's Issues

Widget not active

Hello:

The fake radio and checkboxes are not themselves active: you can only click on the label to set them.

Here is a diff to activate them:

57a58,62

      // make fake input active 
              $(this).prev().click(function () {
              $(this).next().click();
              });

80a86,90

      // make fake input active 
              $(this).prev().click(function () {
              $(this).next().click();
              });

Checkbox is only able to be clicked if it's inside the label tag

I noticed that the checkbox element can only be clicked if it's inside the label tag. If it is outside the label tag, only the label can be clicked to change the status of the checkbox. For example:

<form>
    <input type="checkbox" name="Checkbox" id="checkbox1" value="1" />
    <label for="checkbox1">This checkbox won't be clickable</label>
</form>
<form>
    <label for="checkbox1">
        <input type="checkbox" name="Checkbox" id="checkbox1" value="1" />This one will be clickable!
    </label>
</form>

I believe the W3C would prefer that input elements are outside of label tags:

http://www.w3.org/TR/html4/interact/forms.html

Not working on touch devices

Currently using Custom-radio-checkbox and everything works, except on touch devices. The class changes on touch, so it appears the checkbox has been checked, but it doesn't. It only changes the appearance, not the hidden input's state.

Not getting updated when using prop

When setting $('.foo').prop('checked', false) the checked class does not automatically get removed from the <i>-element. At the moment you have to do a workaround like this:

jQuery('input[type=checkbox]')
    .prop('checked', false)
    .next()
    .removeClass('checkbox-checked');

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.