I am using Asp.net Core MVC, I want to disable a fieldset area. But when i go to browser and manipulate with developer tools in browser, i can easly remove disabled attribute of my fieldset. Here is example:
<fieldset onchange="" disabled>
<ul class="list-group" disabled="true">
@foreach (var item in Model)
{
<li class="list-group-item">
<input type="checkbox" value="@item.UserID" />
<label>
@item.FirstName @item.LastName
</label>
</li>
}
</ul>
this selection field will be enabled when there is text in the input field before it, otherwise it will be disabled.
So how can i prevent this fieldset that nobody can remove its disabled attribute?
I have some ideas:
- When fieldset is onchange event, i can prevent to not remove disabled.
- Take inputs and control in MVC controller.