I have the following page and it does not load
<form:form action="/test.htm" method="post" commandName="demoForm" >
<div id="testSection" style="margin-top: 1.5%;margin-left: 3.5%;">
<span class="test-container">
<label>UserName</label>
<span class="test-container-right">
<form:input path="username" value="${UNAME}" class="text simpleTextField" maxlength="200" style="width:60%" disabled/>
</span>
</span>
<span style="width:auto; padding-left: 30%; padding-bottom: 4%; text-align:center; float:right; clear:both;">
<input type="submit" class="btn" style="width:auto;" value="Save" />
</span>
</div>
</form:form>
but when i change it to
...
<span class="test-container-right">
<form:input path="username" />
</span>
...
It works and loads correctly. Why am I not allowed to set html properties for the form: input spring. How can i achieve this? When checking an item, it expands to
<input id="username" type="text" value="" name="username"></input>
I need to fill in its value, and also provide it with a class and additional attributes such as width.
source
share