javascript - jQuery - Enable/Disable a button following checkboxes state -


I am using ASP.NET MVC4 to develop a web app. I have a page that has a submit button that should only be enabled, if one of my two checkboxes is (enabled) the thing is, I try to add the "or" operator to the following script I am, but it does not give me what I want. So, this is my script:

And this is the part that I want to improve:

  $ (document) .ready (function () (The_terms = $ ("# the-terms"); the_terms2 = $ ("# the-terms2"); the_terms.click (function () {if ($ (this) .is (":" checked Att $ ("disabled", "disabled");}}});} Code>  

And I can not find any way to tell my document "Okay, if any of these check boxes (or both) are checked, then we press the button If not, then allow it Do not give ".

Any ideas people?

can be done with it Is:

  $ ('.' Checkbox '). Change (function () {$ (' # submitBtn '). Note:  
  • This check box The class name is found in the checkbox , so it will work with two checkboxes, while your original code is viewing the same checkbox via its ID
  • Change Do not do events .

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -