How do I get an onkeypress event for TextArea?

Questions and answers for designing and implementing forms in Servoy

How do I get an onkeypress event for TextArea?

Postby tomasz.andres » Tue May 30, 2023 7:43 pm

Hey guys, how would one fire an onkeypress event for a TextArea?

I noticed that this event does not exist and the only data change event only triggers once you click off the text field.
This is a critical thing as I'd like to update the state of a form dynamically.

I look forward to your help, thanks!
tomasz.andres
 
Posts: 4
Joined: Tue May 30, 2023 7:41 pm

Re: How do I get an onkeypress event for TextArea?

Postby sean » Tue May 30, 2023 8:32 pm

Hi Tomasz,

Yes, it's easy in Servoy!

Use the SvyKeyListener plugin.
https://github.com/Servoy/svyKeyListener/wiki

1. Design-time: add the attribute to your text area (or any component)
2. On Show: Use the plugin to register your callback handler
3. Receive the text in your callback method.

Best,
Sean
Software Engineer
Servoy USA
sean
 
Posts: 370
Joined: Mon May 21, 2007 6:26 pm
Location: USA

Re: How do I get an onkeypress event for TextArea?

Postby tomasz.andres » Tue May 30, 2023 8:55 pm

Thank You, Sean, you're a hero!
tomasz.andres
 
Posts: 4
Joined: Tue May 30, 2023 7:41 pm


Return to Forms

Who is online

Users browsing this forum: No registered users and 2 guests

cron