0
Hello, I’m doing a mini-project on jsfidlle, follows the link https://jsfiddle.net/elenderg/wzarrg06/ 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 put the limit of 6 as an example, the correct one would be the limit to adjust 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 the checkboxes
by some kind of button.
the first example is closer than I want, but I’m still determining the checkbox limit, when the user should be doing it, by clicking on the button. no further, thank you very much.
– Elender Góis Gallas
I tried to change my function for this, adjusting the values, but not my other functions...
– Elender Góis Gallas