java – Spring表单输入无法禁用

我想禁用< form:input>禁用该属性,但它不起作用.

<td class="value">
                <sec:authorize access="hasAnyRole('ROLE_EDIT_DEVICE_INSTALL_DATE')">
                    <form:input path="installDt"  maxlength="10" size="10"  cssClass="installDatePicker" /> 
                    <form:errors path="installDt" cssClass="errormsg" />
                </sec:authorize>
                <sec:authorize access="!hasAnyRole('ROLE_EDIT_DEVICE_INSTALL_DATE')">
                    <form:input path="installDt"  maxlength="10" size="10"  cssClass="installDatePicker" disabled="disabled" /> 
                    <form:errors path="installDt" cssClass="errormsg" />
                </sec:authorize>  
</td>

有人有任何想法解决它吗?

要禁用它,请使用disabled = true.它接受真假.

<form:input path="installDt"  maxlength="10" size="10"  cssClass="installDatePicker" disabled="true" />
翻译自:https://stackoverflow.com/questions/29391682/spring-form-input-cant-be-disable

转载注明原文:java – Spring表单输入无法禁用