Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Capturing keystroke events via FormAPI
bcnichols
Wondering if anyone knows of a way to capture keystroke events within DCTs in the FormAPI. I need to trigger an event eacah time a user types in a specific field.
Find more posts tagged with
Comments
Migrateduser
There is currently no supported way to do this within the FormAPI framework, but here is a short overview of how to do this in vanilla Javascript:
http://www.faqts.com/knowledge_base/view.phtml/aid/2209
As I see it, the only way this
could
work is by accessing the DCT's document object directly, outside of FormAPI. Very much a hack, but it's very likely that it could be done.
Dave
Current Environment(s):
(1) TS 6.1 SP1 on W2K3
(2) TS 6.1 SP2 on W2K
(3) TS 6.1 on W2K
bcnichols
Thanks for the reply. I am aware how to do it with standard JS. Do you (or someone else) have an example of the object structure I would have to define to get at the keystroke events? I haven't hacked the FormAPI before (as fun as it sounds).
Thanks!
Migrateduser
It's not fun but it IS fun to feel like a genius after it's all done
What version are you working with? 6.5 might offer some flexibility.
Dave
Current Environment(s):
(1) TS 6.1 SP1 on W2K3
(2) TS 6.1 SP2 on W2K
(3) TS 6.1 on W2K
bcnichols
Sorry meant to include this in the original post. I am currently on TS 6.1. Migrating to 6.5 most likely within 05, but this app needs to be completed irrespective of migration.
Thanks,
BN
Migrateduser
Okay, well it seems that if you can access the DCT's document object via recursive alerts in the FormAPI (which I've done and although it's a bit of a pain, it shouldn't take a long time), you could register the event by:
top.****.onKeyPress = top.yyy.handler();
... where **** is that logical namespace that you'd need to figure out, or let me know if you need help with that step. 'yyy' represents the namespace of wherever the handler() function is, which, as I see it, can reside anywhere -- although, I could be wrong with that.
After **** and yyy are defined and the event is registered, the rest seems trivial. Let me know if you need clarification.
Dave
Current Environment(s):
(1) TS 6.1 SP1 on W2K3
(2) TS 6.1 SP2 on W2K
(3) TS 6.1 on W2K