I\'m stuck on figuring out the logic to make a drop down menu keyboard accessible.
The HTML is structured as such (extra class names used for clarity):
I had a similar issue... I created a jsfiddle to determine when a parent fieldset loses focus and then calling a function. It could certainly be optimized, but it's a start.
http://jsfiddle.net/EKhLc/10/
function saveFields() {
$.each($('fieldset.save'),function(index, value) {
// WHERE THE POST WOULD GO
alert('saving fieldset with id '+ value.id);
$(value).removeClass('save');
});
}
$('.control-group').focusin(function(){
var thefield = $(this).parent('fieldset');
if (!thefield.hasClass('active')) {
if($('fieldset.active').length > 0){
$('fieldset.active').removeClass('active').addClass('save');
saveFields();
}
thefield.addClass('active');
} else {
console.log('already active');
}
});