I've made a function which selects an item when you click on it. And made it so when I've selected more than 10, it stops adding to selectedItems.
But when 10 items is selected, I can still toggle the class d-items-selected by clicking. How do I disable that? I've tried to use stop() but that canceled the hole thing, so I couldn't 'de-select' the items again.
$(document).ready(function(){
$('.d-items').on('click', function(e){
e.preventDefault();
$(this).toggleClass('d-items-selected');
var selectedItems = $('.d-items-selected').length;
if(selectedItems > 10) {
$('.d-items').finish();
} else {
$('#ItemsSelected').html(selectedItems);
}
});
});
session_destroy();) and is keeping it in cache/same session. If you destroy the session array and try again, I'm betting it will work. I've seen that happen often before. You should also add anexit;after your header as your code may want to continue to execute further down. You also need to check if the session was started inside all other files using those (sessions). This might even be a caching issue.