Dynamic pull down menus (CGI)

Fuzzyman fuzzyman at gmail.com
Wed Jan 25 07:00:10 EST 2006


jslowery at gmail.com wrote:
> You will be quite limited without the use of JavaScript to perform this
> kind of dynamic functionality. HTML alone cannot do this. You can use
> dynamically generated Javascript, AJAX, Flash or Java.
>
> One possible would be to just use HTML forms and add in an extra button
> click after the user makes their selection from the first select
> element.
>
> You could create the options for a select element using a CGI script
> and contain the select element in a form. Position a submit button
> beside the select element to submit the user's choice back to the
> server.
>
> A handling CGI script could then look at the value and recreate the
> first select box and the second select box with the appropriate values.

That's the only way I know of from pure HTML - make the top level a
link, which fetches a new page showing the sub-menu.

This means a full page reload for each toplevel menu. A little bit of
javascript in the page will remove that. You should find cut & paste
scripts fairly easily to do this. I believe there is even a Python
script to dynamically generate the javascript - I *think* from the guy
who wrote releaseforge...

All the best,

Fuzzyman
http://www.voidspace.org.uk/python/index.shtml




More information about the Python-list mailing list