PDA

View Full Version : Disable Inputtext


blmetz
02-02-2004, 02:01 PM
Antun,

Is there a way to disable an inputtext through script?



Thanks,
Brian

antun
02-02-2004, 02:16 PM
Not an API per se, but you could set up a delegate that listened for the ontext event, and then set it to "" (or some other value), and then reset the delegate - something like (untested):


<button id="mybutt" onclick="this.clearAndDisable()">Disable
<method name="clearAndDisable">
myinput.setText("");
this.myDel = new LzDelegate( this, "clearAndDisable", myinputtextfield, "ontext" );
</method>
</button>


-Antun

emaender
02-06-2004, 04:17 PM
I must be doing something wrong. I cannot get the ontext event to fire on a simple inputtext element. Consider the code below:

<inputtext name="term" x="112" bgcolor="0xffffff" width="120" >
<method event="ontext" >
debug.write("Ontext event sent...");
</method>
</inputtext>

I can type in the "term" field, leave the field, come back, clear it out, no matter what I do the "ontext" event will not fire.

Can you help me with this?

Thanks in advance for your attention!

antun
02-06-2004, 04:24 PM
What LPS version are you using? It works in 2.0.

-Antun

emaender
02-06-2004, 04:33 PM
which I installed in December. Should I try upgrading to the latest version of 2.0?

thanks,
Eric

antun
02-06-2004, 04:34 PM
Yes, if you're on BETA, you should definitely move to 2.0 final.

-Antun