Dynamic pull down menus (CGI)

K

Keith Burns

Hi,

I have seen two entries in the archives for this topic:

1. Uses hypertext, not a pulldown menu to feed parameters back to the python
CGI
2. The other actually used Java.

Is there a way using Python for CGI such that when a user selects an item
from one pull down menu (ie FRUIT or VEGETABLE or MEAT) that another pull
down menu is filled with appropriate selections (If FRUIT in the first, then
APPLES, ORANGES etc... you get the idea)... without resorting to JavaScript?

Any references to RTxM are greatly appreciated...

Cheers
Keith
 
J

jslowery

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.
 
F

Fuzzyman

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top