how can i make a textfield read only in grails.
I tried with readonly attribute on textfield as below but its not working.
<g:textField name="fname" size="14px" id="fname" value="${patient.fname}" readonly="true">
It does not allows readonly, try disabled="true"
If you use disabled="true" the value will not actually be submitted in the form, so the <g:field/> tag should be used.
For example,
<g:field type="text" name="name" readonly="readonly" value="${instance.?name}"/>
More info here
You can use readonly="readonly"
来源:https://stackoverflow.com/questions/6798558/how-can-i-make-a-textfield-read-only-in-grails