3.2.0

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
March 29,
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
March 29,
Thank you very much!
Odimar Tomazeli
April 11,

This topic is archived.

See also:


Back to support forum