Search code examples
htmlperlcgiframeset

Divide a CGI script into a top fixed part and a main window


I have a CGI script which is written in Perl. I need to divide this script so that it displays a top fixed part and a main window which supports scrolling.

Also I need to be able to make some actions in the top bar such as select a checkbox, and update the main window based on the top bar actions.

I have read that it is possible to use <frameset> and split my script into two scripts, but I don't know how to implement the dynamic change into the main window based on the action performed into the top window.

What is the best approach?


Solution

  • I may have misunderstood but it sounds like you might want a top menu bar and then the main content? Have you considered using a templating system and a wrapper script that includes the top menu?

    http://template-toolkit.org/docs/manual/Directives.html#section_WRAPPER

    Then you can load other pages or content as you wish. If you particularly need to avoid a page load you could load the different content using AJAX but it's not obvious that would be a good approach.

    You should be able to use appropriate CSS to pin the menu to the top, while still allowing scrolling of the rest of the page.