Hi,
I have a list of checkboxes, but when I click to check one all checkboxes is checked.
This is when using Ajax binding:
But when using Server binding it works as it should:
Is it some sort of a bug or is the code wrong typed in some way?
Original code:
/Mattias
I have a list of checkboxes, but when I click to check one all checkboxes is checked.
This is when using Ajax binding:
<
input
id
=
"SelectedRoles_Administrators"
type
=
"checkbox"
value
=
"Administrators"
name
=
"SelectedRoles"
data-bind
=
"checked:SelectedRoles"
>
<
label
for
=
"SelectedRoles_Administrators"
>Administratör</
label
>
<
input
id
=
"SelectedRoles_SuperAdministrators"
type
=
"checkbox"
value
=
"SuperAdministrators"
name
=
"SelectedRoles"
data-bind
=
"checked:SelectedRoles"
>
<
label
for
=
"SelectedRoles_SuperAdministrators"
>Superadministratör</
label
>
<
input
id
=
"SelectedRoles_Administrators"
type
=
"checkbox"
value
=
"Administrators"
name
=
"SelectedRoles"
>
<
label
for
=
"SelectedRoles_Administrators"
>Administratör</
label
>
<
input
id
=
"SelectedRoles_SuperAdministrators"
type
=
"checkbox"
value
=
"SuperAdministrators"
name
=
"SelectedRoles"
>
<
label
for
=
"SelectedRoles_SuperAdministrators"
>Superadministratör</
label
>
Original code:
@foreach (var role in roles)
{
<
input
type
=
"checkbox"
name
=
"SelectedRoles"
id
=
"SelectedRoles_@(role.Enum)"
value
=
"@role.Enum"
/><
label
for
=
"SelectedRoles_@(role.Enum)"
>@role.Text</
label
>
}