Giter Site home page Giter Site logo

Comments (7)

AlonCG avatar AlonCG commented on May 18, 2024

I am having something similar happen (w/wo using an icon in the label)... though I have not modified the css yet (may try that tomorrow or so). Here is how the HTML is generated (using a standard checkbox works fine):

<div class="checkbox checkbox-info">
    <input data-val="true" data-val-required="The IsKey field is required." id="TableColumns_1__IsKey" name="TableColumns[1].IsKey" value="true" type="checkbox">
    <input name="TableColumns[1].IsKey" value="false" type="hidden">
    <label for="TableColumns_1__IsKey">Is Key<i class="fa fa-fw fa-key"></i></label>
</div>

The input tag is being generated from an ASP.NET MVC Razor tag, could that be a problem?

from awesome-bootstrap-checkbox.

JoelViney avatar JoelViney commented on May 18, 2024

@AlonCG It doesn't like there being a hidden input with the same name. That is causing it to fail.

from awesome-bootstrap-checkbox.

micrum avatar micrum commented on May 18, 2024

This problem fixed simply adding z-index equals 1 to inputs.
Check out Plunker

from awesome-bootstrap-checkbox.

swilerdelp avatar swilerdelp commented on May 18, 2024

This issue has not been resolved. I have the most recent version and the checkbox value is not being changed by the mouse click.

from awesome-bootstrap-checkbox.

swilerdelp avatar swilerdelp commented on May 18, 2024

Sorry, I am incorrect, I did have a earlier version than the most recent. My apologies.

from awesome-bootstrap-checkbox.

mibamur avatar mibamur commented on May 18, 2024

@flatlogic reopen it

from awesome-bootstrap-checkbox.

rock-walker avatar rock-walker commented on May 18, 2024

I played with bootstrap checkbox and ASP.NET MVC CheckBoxFor for half a day
and applied solutions with "awesome-bootstrap-checkbox", thoroughly checked every line of code.
That didn't work for me!

As "@Html.CheckBoxFor" appended <input type="hidden" ... /> after checkbox input, the bootstrap checkbox become UNclickable. Unfortunately.

My solution to this problem is next:

  1. throw out "@Html.CheckBoxFor" from code and exchange it on classic
    <input type="checkbox" id="cb1" @(Model.SomeBoolProperty ? "checked" : "")/>
    <label for "cb1">Text</label>
  2. Add to the top of the *.cshtml page asp.net hidden control:
    @Html.HiddeFor(x => x.SomeBoolProperty)
    That control will store your value for a model.
  3. And in "Save"/"Post"/"Send" handler in javascript block update Hidden element value from Checkbox element (f.e., using JQuery):
    $('#SomeBoolProperty').val($('#cb1').is(':checked'))
    Thus your model will valid and actual for .NET Controller.

from awesome-bootstrap-checkbox.

Related Issues (20)

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.