[Project_owners] textbox action

Adam Judson adamsplugins at gmail.com
Sun Mar 5 15:21:53 EST 2006


<textbox command="translate" type="timed" timeout="0"/> works.  Where translate
is a <command>.

Basically a timed textbox fires every [timeout] seconds AND when
you press enter.  As above, the timeout never fires, but the enter
behaviour remains.

I don't see why it wouldn't work with oncommand too, but as you have a
button, using a command element seems like a good idea.

Adam

On 05/03/06, Neil <neil at parkwaycc.co.uk> wrote:
> Michael Bar-David wrote:
>
> > another stupid question (I searched, but didn't get any result):
> > I have the folowing code:
> >
> > <hbox>
> >     <textbox id="text2trans" value=""/>
> >      <button id="translate_bt" label="Translate"
> > oncommand="Translate()"/>
> > </hbox>
> >
> > how do I make, that after writing int the textbox, and clicking
> > Return, the function Translate() will called ?
>
> I know no easier way than to do <textbox onkeypress="if (event.keyCode
> == KeyEvent.DOM_VK_RETURN) Translate();">
>
> Note that if you have other elements (e.g. <dialog>) listening for
> VK_RETURN you may also need to call event.preventDefault() and/or
> event.preventBubble().
> _______________________________________________
> Project_owners mailing list
> Project_owners at mozdev.org
> http://mozdev.org/mailman/listinfo/project_owners
>


More information about the Project_owners mailing list