How can I write a text box in the grail only?

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">
+5
source share
3 answers

It does not allow reading only, try to disable = "true"

+3
source

If you use disabled = "true", the value will not actually be presented on the form, so you should use a tag <g:field/>.

For instance,

<g:field type="text" name="name" readonly="readonly" value="${instance.?name}"/>

More here

+14
source

readonly = "readonly"

+1
source

All Articles