Eric,

  $html .= $cgi->popup_menu(-name => 'id', -values => \%terms);

where:

  -name is the name of the parameter I want returned
  -values is a reference to a hash containing id and value pairs.

The problem is that -values is a hash, and when CGI.pm displays the pop-up menu the items do not come out sorted. (They were inserted into the hash in a sorted order.)

Is there some I can get CGI.pm to output the popup items in sorted order, or should I write my own little function to do this for me?

According to the CGI man page I have, -values takes an _array_ reference not a hash reference. I think you need to use the -lables option which does take a reference to a hash. The -lables hash lets you display one thing to the user and return another value to your script.

Regards,

Ashley.
--
Ashley Sanders [EMAIL PROTECTED]
Copac http://copac.ac.uk -- A MIMAS service funded by JISC

Reply via email to