2
I am checking a check box to see if you have a type="radio" selected. The problem that check is running the calculation even when I uncheck the check box. I did the following test to see what was happening.
console.log($("input[type='checkbox'][id='SavePaper']").is(':checked') );
The test result was:
true false
false true
true false
Follow the image
Why it happens and how to solve?
Updating: checkbox code
<div class="md-checkbox" onclick="getValue()">
<input type="checkbox" id="SavePaper" name="SavePaper" class="md-radiobtn">
<label for="SavePaper">
<span class="inc"></span>
<span class="check"></span>
<span class="box"></span>
</label>
</div>
It has nothing to do directly with your question, but given that the id’s should be unique in the DOM (page) because you simply don’t:
$('#SavePaper').is(':checked');
. On second thought your problem may come from there. The two buttons even though they have the sametype
, cannot have equal id’s. fix this and see if the problem remains– Miguel
gave exactly the same thing
– gabrielfalieri
I’ll put checkbox code...
– gabrielfalieri
I updated the comment above. I didn’t say I would solve the problem, I just said I would be better
– Miguel
They are not with equal ids
– gabrielfalieri
The checkbox is with one and the radio is with another
– gabrielfalieri
You should put the code you have (preferably functional, in snipet) so that it is easier to help you
– Miguel
Let’s go continue this discussion in chat.
– gabrielfalieri