Hey, I was wondering how you go about displaying certain parts of an array in checkboxes. My example is that I have a select box, when a certain value is selected I want to be able to display certain parts of that array it has in common with another. Can create a quick JSFiddle if needed.
var PRIVILEGE_PROFILES = [
{ PROFILE_ID: "ADickinson", COMPANY_CODE: "GW", PRIVILEGE_CODE: ("ALeave", "ALVwBlkLV", "ALAdmin", "DAAppAccess"), SECTOR: "01" }
];
That's the array that is displayed in my select box, when the PROFILE_ID is selected I want to display all the different PRIVILEGE_CODES it has into multiple check boxes inside a div. However the PRIVILEGE_CODE must match with a UNIQUE_CODE from this array then instead the privilege_code/unique_code being displayed in the checkboxes I need SEC_PRIVILEGES.Name to be displayed instead.
var SEC_Privileges = [
{ Unique_Code: "ALeave", Name: "Annual Leave Access" },
{ Unique_Code: "ALVwBlkLV", Name: "Annual Leave Blcok LeaveAccess" },
{ Unique_Code: "AlAdmin", Name: "Annual Leave Admin" },
];
This is the code for my actual select box, I've already done the methods to populate it with PROFILE_ID's
var profileselectHTML = "<select name='select_profile' id='select_profile' class='form_drop_down' data-role='none'>" +
"<option>None</option>";