popup_menu

Team-Fly    

 
Webmaster in a Nutshell, 3rd Edition
By Robert Eckstein, Stephen Spainhour
Table of Contents
Chapter 14.  The CGI.pm Module


popup_menu

 print $query->popup_menu('  name  ',  \@array  [,'  selected  ',  \%labelhash  ]) 

Generates a pop-up menu.

name

The name to assign the input to (required).

\@array

An array reference listing the menu items. You can also use an anonymous array reference (see the second example).

selected

The menu item to be initially selected (default is first menu item or the item selected in previous queries).

\%labelhash

A hash reference listing labels for each menu item. Default is menu item text. For example:

 %labels = ('UPS'=>'United Parcel Service (UPS)',     'FedExO'=>'Federal Express Overnight - 10AM delivery',     'FedExS'=>'Federal Express Standard - 2PM delivery',     'FedEx2'=>'Federal Express 2nd Day Delivery'); print $query->popup_menu('delivery_method',                      ['UPS', 'FedExO', 'FedExS', 'FedEx2'],                         'FedExO',                         \%labels); 

Using named parameters, the syntax is:

 print $query->popup_menu(-name=>'  name  ',                             -values=>\  @array  ,                             -default=>'  selected  ',                             -labels=>\%  labelhash  ,                             -onChange=>  function  ,                             -onFocus=>  function  ,                             -onBlur=>  function  ); 
-onChange=> function

Browser should execute function when the user changes the text field.

-onFocus=> function

Browser should execute function when the focus is on the text field.

-onBlur=> function

Browser should execute function when the focus leaves the text field.


Team-Fly    
Top


Webmaster in a Nutshell
Webmaster in a Nutshell, Third Edition
ISBN: 0596003579
EAN: 2147483647
Year: 2002
Pages: 412

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net