Saturday 13 September 2014

How to Make Spring form input as Read Only

Spring JSTL form:input tag the proper syntax is readonly=”true"
==============================================
<form:input path="caseId" readonly="true"/>

=======================================================================
And if you are using HTML tag input then this will be the tag readonly="readonly"

<input name="caseId"  readonly="readonly" class="required"/>
=======================================================================

spring mvc form input readonly syntax is readonly="true"

for Html tag it is  readonly="readonly"

2 comments:

  1. Thanks for the concept but, readonly can not be a required field :p

    ReplyDelete
    Replies
    1. Yeah!! I got you what you want to say. BUT this is case let say we are fetching user details from DB and one of attribute is UserID and this one is required for all CRUD operation,and we do'not want it should be changed once it is created then above will be use full

      Delete