Re: FAQ: How do I make a pop-up menu in HTML?

From: Alan J. Flavell (flavell_at_ph.gla.ac.uk)
Date: 10/18/04


Date: Mon, 18 Oct 2004 22:01:36 +0100


On Mon, 18 Oct 2004, Keith Keller wrote:

> It's probably called that because the corresponding CGI.pm method is
> called popup_menu. Perhaps an unfortunate choice, but remember that
> CGI.pm predates (IIRC) pop-up browser windows.

Fair comment

> popup_menu creates the equivalent of a drop-down list.

This is all quite OT (and IMNSHO only goes to illustrate that those
who accept off-topic answers rate to get the quality of response that
they deserve...), but if we're going to tackle it at all, then I think
it should be tackled accurately.

popup_menu creates a particular kind of HTML *selection list*
(specifically, one which has the "size" attribute set to 1).

As the HTML specification rightly points out:

 Visual user agents are not required to present a SELECT element as a
 list box; they may use any other mechanism, such as a drop-down menu.

http://www.w3.org/TR/html401/interact/forms.html#h-17.6

But it might be more informative if it pointed out that there's no
absolute requirement to present the form visually at all! So, what
would a "pop-up menu" (or "drop-down", for that matter) sound like on
a speaking browser?

Or to put it another way: it's entirely the business of the client
agent (browser etc.) to decide how to actually present a given
selection list. "popup menu", "dropdown list", "scrolling list" etc.
are no more than *proposals*, for the client agent to action or not
according to circumstances.

> As always perldoc CGI for more details.

That's a good general principle, indeed; but in this case
I'm sorry to have to say that you get better results by reading the
author's own HTML documentation[1]; versus the POD (and, even more
misleading, the HTML-ified POD) that gets distributed with Perl.

But whichever source of documentation you choose for the CGI.pm
module, the end result is an HTML document sent to the client.
One would find out more about the HTML and its properties and
limitations in another place, of course.

have fun

[1] http://stein.cshl.org/WWW/software/CGI/

Of course one *should* be reading the version of the documentation
that goes with the version of the module that one is using;
alternatively, install the version of the module that goes with the
version of the documentation that one is using ;-}



Relevant Pages

  • Re: How do I get HTML sent to server?
    ... are trying our best to approximate and document the client view. ... anyone can but browser cannot. ... mechanics of this particular browser applied to the server HTML ...
    (comp.lang.javascript)
  • Re: Which is more secure Outlook or Hotmail?
    ... How do you know it's untrusted and HTML without opening the message? ... Just discard the HTML and let the client display the ... Can you switch to a text-only view in your browser too? ... If a hosted service ever gets compromised that might be helpful.-) ...
    (microsoft.public.security)
  • Re: Code-Behind variables
    ... more accurately it simply sends TEXT to the browser (note: ... be any value from any data-type, but it gets sent to the client as text). ... The text could be anything at all (HTML, JavaScript, VBScript, XML, etc.). ... It is very easy to add and read items to/from ViewState in the CodeBehind ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Div section does not dispaly
    ... You told the browser to make P2 visible by using JavaScript: ... But the browser is never even receiving the P2 html because of the Visible attribute in the server declaration: ... As Marina stated, you can have it only one way or the other. ... that div won't even exist in the HTML on the client. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: vbscript / Internet Explorer info
    ... HTML and Dynamic HTML ... Even in the Microsoft documentation you will ... find only a few VBScript examples of client side, ... The reason is that only IE supports VBScript on the client. ...
    (microsoft.public.scripting.vbscript)