in reply to Dynamic values in scroll box?

I have a cgi script for my internet chatroom, and I cut and paste several lines here:

if ($peer) { $msg .= $cgi->scrolling_list(-name => 'peer', -value => \@chat +_user, default => $peer, size => 5, multiple => 'false'); } else { $msg .= $cgi->scrolling_list(-name => 'peer', -value => \@chat +_user, default => "All", size => 5, multiple => 'false'); }

It basically creates a scrolling list and take values (chat room user names) from a list @chat_user. As size is 5, so the view of the list contains 5 elements.

In your case, if you want the names to be showed in the scrolling list, just:

print $query->scrolling_list(-name=>'list_name', -values=>keys %names, -default=>['eenie','moe'], -size=>5, -multiple=>'true');

Replies are listed 'Best First'.
Re: Re: Dynamic values in scroll box?
by coldfingertips (Pilgrim) on Dec 26, 2003 at 07:44 UTC
    Thank you so much! That does work, but I have one last question. Is it possible to make the names into links in the scroll box?
      Not to my knowledge. But that's just because browsers don't support that (it's not part of the "HTML standard").

      Liz

      Depends on how much scroll box functionality you want. You could something ..interesting.. like sticking the values in a div tag and then using css to make it scroll..