Limite la sélection des parfums
This commit is contained in:
parent
fdc84b0934
commit
b3f203bd1a
@ -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');
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
Loading…
x
Reference in New Issue
Block a user