Lightweight, Component-based, and Database-oriented Web Application Framework

About | Overview | Documentation


Documentation > Modules and APIs > Select_Option




The core module to help generate HTML code for select form element (dropdown list box).


1. Instantiation and Basic Parameter Setting

my $s_opt = new Select_Option;

Option 1 - Manually set the captions and values of the dropdown list box options
$s_opt->set_Values("value_1", "value_2", "...", "value_n");
$s_opt->set_Options("option_1", "option_2", "...", "option_n");

Option 2 - Set the captions and values using items from database table..

Set current selected items of the dropdown list box to be generated.
$s_opt->set_Selected("value_1", "...", "value_n");

2. Generating Dropdown List Box

my $content = $s_opt->get_Selection;