Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how can i make a textfield read only in grails?

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">
like image 563
laxmi Avatar asked Jul 23 '11 05:07

laxmi


1 Answers

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

like image 160
CodingStix Avatar answered Oct 21 '22 00:10

CodingStix