Hi there,
I have a script that is created in PHP and also Angular. The script creates a form with some options in a select input.
This is an example of one:
$scope.ethnicgroups = [{
id: '',
name: 'Please select'
}, {
id: 'White',
name: 'White'
},
{
id: 'English, Welsh, Scottish, Northern Irish or British',
name: 'English, Welsh, Scottish, Northern Irish or British'
},
{
id: 'Irish',
name: 'Irish'
},
{
id: 'Gypsy or Irish Traveller',
name: 'Gypsy or Irish Traveller'
},
{
id: 'Any other White background',
name: 'Any other White background'
},
{
id: 'Mixed or Multiple ethnic groups',
name: 'Mixed or Multiple ethnic groups'
},
{
id: 'White and Black Caribbean',
name: 'White and Black Caribbean'
},
{
id: 'White and Black African',
name: 'White and Black African'
},
{
id: 'White and Asian',
name: 'White and Asian'
},
{
id: 'Any other Mixed or Multiple ethnic background',
name: 'Any other Mixed or Multiple ethnic background'
},
{
id: 'Asian or Asian British',
name: 'Asian or Asian British'
},
{
id: 'Indian',
name: 'Indian'
},
{
id: 'Pakistani',
name: 'Pakistani'
},
{
id: 'Bangladeshi',
name: 'Bangladeshi'
},
{
id: 'Chinese',
name: 'Chinese'
},
{
id: 'Any other Asian background',
name: 'Any other Asian background'
},
{
id: 'Black, African, Caribbean or Black British',
name: 'Black, African, Caribbean or Black British'
},
{
id: 'African',
name: 'African'
},
{
id: 'Caribbean',
name: 'Caribbean'
},
{
id: 'Any other Black, African or Caribbean background',
name: 'Any other Black, African or Caribbean background'
},
{
id: 'Other ethnic group',
name: 'Other ethnic group'
},
{
id: 'Arab',
name: 'Arab'
},
{
id: 'Any other ethnic group',
name: 'Any other ethnic group'
} ];
// a pre-selection by value
$scope.home.quizDatabase.frmethgroup = '';
// a pre-selection by object-identity
$scope.asObject = $scope.ethnicgroups[0];
What I would like to do is have some headers to some of the options in the “Ethnic group” select, similar to this:
I can’t seem to paste all the code as it’s too long.
Can anyone help me create these headers? For example :“White”, " Mixed or Multiple ethnic groups" etc. Also, so they are not selectable? I am not sure how to add other attributes that will be outputted in the HTML of the options.
Thank you