Limite la sélection des parfums

This commit is contained in:
Michael RICOIS 2017-09-07 17:59:11 +02:00
parent fdc84b0934
commit b3f203bd1a

View File

@ -13,8 +13,6 @@ $(function(){
});
$('.configurator-opt-datepicker').datepicker({dateFormat: "dd/mm/yy"});
$('.configurator-opt-file').fileupload({
dataType: 'json',
done: function (e, data) {
@ -31,4 +29,34 @@ $(function(){
var progress = parseInt(data.loaded / data.total * 100, 10);
}
}).prop('disabled', !$.support.fileInput).parent().addClass($.support.fileInput ? undefined : 'disabled');
$('input.PARFUMS1').on('click', function(e){
var inputElems = $('input.PARFUMS1');
count = 0;
for (var i=0; i<inputElems.length; i++) {
if (inputElems[i].type === "checkbox" && inputElems[i].checked === true){
count++;
console.log(count);
if (count > 1) {
$(this).prop('checked', false);
$(this).parent().removeClass('checked');
}
}
}
});
$('input.PARFUMS2').on('click', function(e){
var inputElems = $('input.PARFUMS2');
count = 0;
for (var i=0; i<inputElems.length; i++) {
if (inputElems[i].type === "checkbox" && inputElems[i].checked === true){
count++;
console.log(count);
if (count > 2) {
$(this).prop('checked', false);
$(this).parent().removeClass('checked');
}
}
}
});
});