zkr500 has asked for the wisdom of the Perl Monks concerning the following question:

Is there a text field event handling function in PERL that will fire up when the user clicks away from or leaves a text field? Or is it automatic? I know I can do this alternatively in Javascript, but Id rather do it in Perl for personal reasons. Thanks in advance.

Replies are listed 'Best First'.
Re: Text field event handling
by graff (Chancellor) on Jul 04, 2011 at 04:39 UTC
    Your reference to javascript leads me to assume that you're talking about interactions between a web browser client and a perl script running on a web server. As I understand it, the only way for this to happen is to have javascript functions running on the browser client that will send http requests back to the server for each relevant event, and then handle whatever the server sends out in return (if anything).

    There's no other way for a server to know what a client is doing with a page that was last sent, and the server cannot cause perl code to execute on the client (unless/until someone builds and distributes a browser that runs perl instead of javascript -- if that's ever been done, I suspect it's not something that gets wide usage or support).

    If you're talking about a "console GUI" application, using Perl/Tk or Perl/Gtk or Perl/Qt or ..., that's a different matter, and of course actions like leaving a text field can be detected and acted on by binding events to callback functions.