Dynamic pull down menus (CGI)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Keith Burns

    #1

    Dynamic pull down menus (CGI)

    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


  • jslowery@gmail.com

    #2
    Re: Dynamic pull down menus (CGI)

    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.

    Comment

    • Fuzzyman

      #3
      Re: Dynamic pull down menus (CGI)


      jslowery@gmail. com wrote:[color=blue]
      > 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.[/color]

      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

      Comment

      Working...