René Nyffenegger's collection of things on the web
René Nyffenegger on Oracle - Most wanted - Feedback -
 

CGI [perl]

Form elements

Text Field

$cgi->textfield(-name      => 'bar',
                -default   => 'foo',
                -size      => 10,
                -maxlength => 20);
Instead of textfield, password_field is also possible.

File Upload

$cgi->filefield(-name      => 'foo',
                -default   => 'bar',
                -size      => 10,
                -maxlength => 20);

Popup (Drop Down)

$cgi->popup_menu(-name  =>'foo',
                 -values=>[qw(one two three)], 
                 -labels=>{'one'   => 'uno',
                           'two'   => 'due',
                           'three' => 'tre'},
                 -default=>'one');
$cgi->popup_menu(-name   =>'foo',
                 -values =>[qw(one two three)],
                 -default=>'one');

Scrollable List

$cgi->scrolling_list(-name     => 'foo',
                     -values   => ['one','two','three','four'],
                     -default  => ['one','four'],
                     -size     => 5,
                     -multiple => 'true',
                     -labels   => \%labels);

Checkboxes

Group of related checkboxes:
$cgi->checkbox_group(-name     =>'foo',
                     -values   =>['one','two','three','four'],
                     -default  =>['one','four'],
                     -linebreak=>'true',
                     -labels   =>\%labels);
Standalone checkbox:
$cgi->checkbox(-name    => 'foo',
               -checked => 'checked',
               -value   => 'is_clicked',
               -label   => 'click me!');

Radio Buttons

$cgi->radio_group(-name     =>'foo',
                  -values   =>['one','two','three'],
                  -default  =>'two',
                  -linebreak=>'true',
                  -labels   =>\%labels);

Buttons

Submit-button
$cgi->submit(-name=>'foo',
             -value=>'Press me!');
Reset-button;
$cgi->reset;
Default-button;
$cgi->defaults('Default');

Hidden Field

$cgi->hidden(-name   =>'foo',
             -default=>['one','two']);