How To make aui input is read only?

thumbnail
angu manikandan, modified 12 Years ago. Junior Member Posts: 72 Join Date: 7/16/12 Recent Posts
Hi,
How To make aui input is read only?

Thanks in Advance.
thumbnail
Atin Agarwal, modified 12 Years ago. Junior Member Posts: 86 Join Date: 2/20/12 Recent Posts
Use the attribute readonly and set this to true

<aui:input type="text" name="name" readonly="true" />

Regards,
Atin Agarwal
Manish Singh, modified 11 Years ago. New Member Posts: 10 Join Date: 8/22/14 Recent Posts
angu manikandan:
Hi,
How To make aui input is read only?

Thanks in Advance.



readonly attribute may not work on aui
use :
<aui:input name="name" disabled="true"/>

-
Regards
Manish Singh
Arun R S Chandran, modified 11 Years ago. Regular Member Posts: 149 Join Date: 3/12/13 Recent Posts
this may help you as well.
thumbnail
Ethan Bustad, modified 11 Years ago. Junior Member Posts: 26 Join Date: 8/23/12 Recent Posts
Manish Singh:

readonly attribute may not work on aui
use :
<aui:input name="name" disabled="true"/>


Keep in mind that "disabled" and "readonly" do two different things: both will prevent the user from editing the value in your input field, but "disabled" will also prevent the value from being passed as a request parameter on form submit, whereas "readonly" will allow the value to be submitted.

The readonly attribute is currently only applied to the aui:input tag if the "type" attribute is specified: if not, the readonly attribute won't show up in the markup.

Also note that readonly="false" still makes the input tag readonly - it's a property setting rather than a true xml attribute. So beware of trying to make a field readonly programmatically, based on some boolean field. It probably won't behave as expected.
thumbnail
Madhava Venganapalli, modified 11 Years ago. Junior Member Posts: 26 Join Date: 6/5/13 Recent Posts
give just aui input field as readonly="true".