I need to implement check all checkbox which will check and uncheck the checkboxes in rows.
TypeScript
@Model.SResource
@Model.KResource
@Model.LocationResource
@for (int i = 0; i 0 ? values[0] : "";
var location = values.Length > 1 ? values[1] : "";
@Html.CheckBoxFor(m => m.Instruments[i].Selected)
@Model.Instruments[i].Text
@status
@location
}
Umair Ahmad42 reputationPosted May 12, 2022, 2:17 PM EDT
Sachin SinghRank #66 · 26.2K reputationPosted May 13, 2022, 1:51 AM EDT
Umair Ahmad42 reputationPosted May 13, 2022, 5:02 AM EDT
I have but your solution gave me an idea i didn't know how to assign class to html.checkboxfor now i have achived the solution using javascript. Jquery somehow not working don't know why.
i am using this.
function toggle(oInput) {
var aInputs = document.getElementsByClassName('chkInst');
for (var i = 0; i < aInputs.length; i++) {
if (aInputs[i] != oInput) {
aInputs[i].checked = oInput.checked;
}
}
}
Sachin SinghRank #66 · 26.2K reputationPosted May 13, 2022, 5:03 AM EDT
Jignesh KumarRank #91 · 22.9K reputationPosted May 14, 2022, 8:12 AM EDT
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts