[######################################################################### # Begins a new form # Param#1: Form title (if undef or '' the no title is displayed) # Param#2: Name of the form # Param#3: Script to be called upon post request #########################################################################] [* sub begin_form { ($title, $name, $script) = @_; captions_colwidth($capt_width); $form_name = $name; $valtext=''; if (defined($title) and ($title ne '')) { *]
![]() |
[+ $title +] |
![]() |
![]() |
##
[# Import all functions from the controls library into script #]
[* Execute ({ inputfile => '_controls_lib.epl', import => 1 }) *]
[# Call functions from the library #]
[*
begin_form('MyFormTitle', 'my_form_name', 'action_script_name');
textinput('Username', 'user', 140, 0, 'User Name');
password('Password', 'pass', 140, 0, 'User password');
form_buttons();
end_form();
*]
####
package LibControls;
use Apache::Reload;
use Embperl;
use Exporter;
use vars qw( @ISA @EXPORT_OK );
BEGIN {
@ISA = qw ( Exporter );
Embperl::Execute({inputfile => $path_to_lib, import => 1, package =>__PACKAGE__});
@EXPORT_OK = qw( begin_form textinput password ... end_form );
}
1;
####
[! use LibControls qw( begin_form, textinput, form_buttons, end_form ) !]
[*
begin_form('MyFormTitle', 'my_form_name', 'action_script_name');
textinput('Username', 'user', 140, 0, 'User Name');
form_buttons();
end_form();
*]
<