Hello, I'm doing a mini-project on jsfidlle, follow the link link There are several buttons and the user will have to select one of them, as shown below:
When the user chooses how many numbers he wants to bet, the table with the numbers appears. The problem is that my function below is not working (I set the limit of 6 as an example, the correct one would be the limit if it adjusted according to the option selected by the user. follows the function code:
(function($){
var currentLimit=6;
$('div.limits > input[type=button]').on('click',function(){
currentLimit = parseInt($(this).data('value'));
});
$('div.checks input').on('click', function(e){
var totalChecked = $('input:checked').length;
if (totalChecked > currentLimit){
e.preventDefault();
}
});
})
Another thing I think would be more practical would be to replace checkboxes
with some kind of button.