:: Forum >>

How to set input object as readonly?

Hi,

I'm trying out the version 2.0.1 and using AW.UI.Input but some functions are not working
var otxtBankAccount = new AW.UI.Input;
otxtBankAccount.setId("txtBankAccount");
otxtBankAccount.setControlText("");
otxtBankAccount.setControlImage("bankaccount");
otxtBankAccount.setAttribute("readonly",true); --> not work
otxtBankAccount.setAttribute("disabled",true); --> change text color but still able to enter/change data
otxtBankAccount.setAttribute('MAXLENGTH', 3); -- not work
otxtBankAccount.refresh();

There is any way around to do that?

Thanks
Odimar Tomazeli
Thursday, March 29, 2007
Odimar, you need to set the readonly attribute on the HTML element inside the Input control, as follows:

otxtBankAccount.getContent('box/text').setAttribute('readonly',true);
Randall Severy
Thursday, March 29, 2007
Thank you very much!
Odimar Tomazeli
Wednesday, April 11, 2007

This topic is archived.


Back to support forum

Forum search