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

Dear Monks:

I have a quick question.

I tried to build a query form, one mode of this form is that from a scrolling list like format when a user "selects" an element of this list, the program will automatically generate another list with elements of actions for further selection under the previous scrolling list.

Note: the "selects" here means just using mouse to click on the selected element, it doesn't involve click on a submit button.

I am wondering if Perl CGI can do it. Or Perl can have some event driven module to carry out such task.

Thank you.

Replies are listed 'Best First'.
Re: Can Perl CGI do it?
by marto (Cardinal) on Apr 19, 2012 at 16:01 UTC

    Since you want to achieve this without clicking submit you'd need to use JavaScript to generate the other list(s) for further selection. If you want a dynamic database driven list think of an AJAX call to a perl script which returns a list of elements matching the criteria.

    Update: For AJAX stuff I use the jQuery framework.

Re: Can Perl CGI do it?
by Corion (Patriarch) on Apr 19, 2012 at 16:03 UTC

    If Perl runs in your users browser, it can do that. Note: Only Internet Explorer had a Perl plugin, and I'm not sure whether it is still supported.

    I recommend learning about HTTP and how it works, and where what code runs at what time.

    To do this kind of scripting of HTML pages, you will need Javascript to run on the client browser.

      Guys:

      Thank you for all your prompt responses. That's the concern I have. It seems that Perl along can not do this. We have to consult javascript.

        It seems that Perl along can not do this.

        Yeah, that is how the internet works. Client side is client side, server side is server side, they talk over HTTP

Re: Can Perl CGI do it?
by Anonymous Monk on Apr 19, 2012 at 15:59 UTC