Check field values against a preset object
Inside one of the $.each calls, you could simplify this part:


if (flag == false){   
    return false;
}



to this:

return flag;


When the value is true, $.each will continue normally, and stop after it is false, so the behavior remains the same.



Instead of:


if (flag == false) {



It's more common to write:

if (! flag) {


For simplicity, it might be a good idea to flip the condition:

if (flag) {
    $(preset + ' i#id').attr('class', 'radio-checked on');
} else {
    $(preset + ' i#id').attr('class', 'radio-unchecked');
    return false;
}


And to reduce code duplication, I would extract the dom lookup that is common in both branches of the if-else:

var preset = $(preset + ' i#id');
if (flag) {
    preset.attr('class', 'radio-checked on');
} else {
    preset.attr('class', 'radio-unchecked');
    return false;
}




The two innermost loops use $.each,
but the outer loop is a traditional for.
For the sake of consistency, it might be good to use $.each for all.