Afternoon,
I have set up the following, the nested ifs are working however when i'd like to be able to pass the title of the array to the alterFields() function, that way the function will cycle through each field stored in the array and apply the CSS class relative to that array (i.e. I have applied the same name to the array as the css class). Unfortunately if I use strings in the css array the $.each in alterfields cycles through each character of the string.
var assigned =[
"UAT Nominee"
];
var applications = [
"Primary Application Affected",
"Other Applications"
];
var comments = [
"Comments"
]
var css = [assigned, applications, comments];
$.each(css, function(x){
var current_class = css[x];
alterfields(current_class);
});
function alterfields(array){
$.each(array, function(i){
var current_field = array[i];
alert(current_field);
$("#WebPartWPQ2 .ms-formlabel nobr").filter(function() {
return $.text([this]) === array[i];
}).closest('tr').toggleClass(array);
});
}
});
Thanks in Advance