in reply to CGI how to lookup a value when a Field is filled in

In the broader sense, lostjimmy's response is entirely correct. You need to use AJAX to do what you describe and he explained what goes on behind the scenes when you do so.

To actually make all this happen, take a look at the CGI::Ajax module on CPAN. It provides a very easy way to set up an interface for Javascript events to trigger Perl functions and display the results.

  • Comment on Re: CGI how to lookup a value when a Field is filled in

Replies are listed 'Best First'.
Re^2: CGI how to lookup a value when a Field is filled in
by d0353101 (Novice) on Feb 04, 2009 at 10:45 UTC
    Hi, I am new to AJAX. I have tried the CGI AJAX Module but I am not getting successful in this and finding it very complex.

    I have tried the example given on link :
    http://www.perl.com/pub/a/2006/03/02/ajax_and_perl.html?page=2

    But it is not working in the desired way.

    It would be a great help if you could provide some working easy example to understand the basics of CGI::AJAX.
    It would help to build up the basics for AJAX.

    Many thanks!!
    -Vivek

      You are making it hard for us to help you better. "It is not working the desired way" does not tell us anything about how the code from the linked article fails for you. Please show the relevant code of your program, your input and the output you get.

      Ajax is still simple HTTP interaction, so writing an "Ajax script" is not different from writing any other CGI script, except that the output is JSON or some other format than HTML, and that the requesting client is likely driven by a JavaScript program.