0

In my form, I have two inputs which are disabled, as the user has to fill them with a keyboard I made on the view. However, when I submit the form, the object arrives with its parameters at 0 (as they are numbers). I know that its the disable tag which makes it happens because when I delete the tag, the values are initialized.

these are my inputs:

 <td>@Html.EditorFor(model => model.Cliente, new { htmlAttributes = new { disabled = "true" } })</td>

How could I disable them and at the same time send the values to the controller?

Erik
  • 21
  • 3

1 Answers1

3

You can use readonly attribute instead of disabled.

disabled form elements are not submitted to post request. Reference1 Reference2

shakib
  • 5,449
  • 2
  • 30
  • 39