0

I have a simple

<form:hidden id="someIdHere" path="somePathHere" value="${somePathHere}" disabled="true"/>

The form's action points to a POST method from the controller. Everything works fine until the moment where the form's modelAttribute is mapped to the MyForm object from controller:

public class MyForm{
    private String somePathHere;
    private String someAnotherPathHere;
    //getters;setters;
}

I have one more <form:hidden> for the someAnotherPathHere attribute but without disabled="true". This field is getting filled but the one where the disabled attribute is true is not getting filled.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
user1234SI.
  • 1,812
  • 1
  • 8
  • 22
  • Can you try `th:value="${somePathHere}"` instead of `value="${somePathHere}"` – Ajit Soman Jul 13 '20 at 08:55
  • yes because inputs which have `disabled` attribute doesn't gets submit to server instead use `readonly` attribute.Also check [this](https://stackoverflow.com/a/7357314/10606400) answer. – Swati Jul 13 '20 at 08:57

0 Answers0