0

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:

  1. When fieldset is onchange event, i can prevent to not remove disabled.
  2. Take inputs and control in MVC controller.
  • 1
    You can't control anything outside of your server. What happens in the user's browser happens in the **user's** browser. – Quentin Apr 08 '22 at 08:07

1 Answers1

-1

You can’t. Anything that happens in the browser is under the control of the user, not the publisher. It’s a user agent, not a publisher agent, after all.

Jim
  • 72,985
  • 14
  • 101
  • 108