how can i make a text field read only in grails.
I tried using the readonly attribute in the text box as shown below, but it doesn't work.
<g:textField name="fname" size="14px" id="fname" value="${patient.fname}" readonly="true">
It does not allow reading only, try to disable = "true"
If you use disabled = "true", the value will not actually be presented on the form, so you should use a tag <g:field/>.
<g:field/>
For instance,
<g:field type="text" name="name" readonly="readonly" value="${instance.?name}"/>
More here
readonly = "readonly"