Code Monkey home page Code Monkey logo

Comments (2)

itsKnight847 avatar itsKnight847 commented on September 28, 2024

@BobWarren Hi,
I just found that lib but I think I can help,
I have seen the demo's and they use the checked attribute instead of disabled (make's sense)
$('#toggle-trigger').prop('checked', true).change()
switch your disabled to checked (on input tags ofcourse).
let me know if it did worked for you

from bootstrap-toggle.

Mahmoud-Ibrahim avatar Mahmoud-Ibrahim commented on September 28, 2024

Hi Everyone,
I am facing the same problem, i am using toggle in a form,
i can't have the value in form POST because it is not considered checked, even i checked it manually.
so i tried to use $('#toggle-trigger').prop('checked', true).change();

in page ready function with no effect

$(document).ready(function() {
$('#IPV6t').prop('checked', true).change();
});

how i solved this problem:
by creating another hidden checkbox and use java script to replicate the status:

  $('#IPV6t').change(function() { 
          $('#IPV6t').val($(this).is(':checked'));                 
          $('#IPV6').prop('checked', $('#IPV6t').is(':checked'));
          $('#IPV6').val($('#IPV6t').is(':checked')); 
      }); 

jquery-3.5.1.min.js:2 Uncaught RangeError: Maximum call stack size exceeded
at String.replace ()
at X (jquery-3.5.1.min.js:2)
at G.get (jquery-3.5.1.min.js:2)
at Object.trigger (jquery-3.5.1.min.js:2)
at HTMLInputElement. (jquery-3.5.1.min.js:2)
at Function.each (jquery-3.5.1.min.js:2)
at S.fn.init.each (jquery-3.5.1.min.js:2)
at S.fn.init.trigger (jquery-3.5.1.min.js:2)
at S.fn.init.S.fn. [as change] (jquery-3.5.1.min.js:2)
at HTMLInputElement. ((index):287)

from bootstrap-toggle.

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.