Introduction
Server Platform
Application Server
Content Generation
Class Library API
   Runtime System
   WebServer
   Process
   Database
   Page
   Context
   Elements
   Templates
   Menu
   User
   CGI
   Form
   Table
   TreeAdmin
   DirectoryTree
   Application
Manual Index

next | previous

Maxscape::Form Package

Member Functions

  1. anchor
  2. button
  3. checkbox
  4. checkbox_group
  5. end_form
  6. end_table
  7. end_td
  8. end_tr
  9. filefield
  10. FileUploadForm
  11. formated_text
  12. FormElementToHTML
  13. FormSelectGroupWidget
  14. hidden
  15. hidden_text
  16. image_button
  17. input_text
  18. Me
  19. MyPage
  20. new
  21. password
  22. popup_menu
  23. radio
  24. reset
  25. select
  26. setState
  27. simple_input_text
  28. start_form
  29. start_table
  30. start_td
  31. start_tr
  32. State
  33. submit
  34. submitBar
  35. text
  36. ${::TEXTAREA}

Synopsis

use Maxscape::Form;

Description

The Maxscape::Form package supplies the functionality to deal with HTML forms via a CGI script.

Examples

my $Form     = Maxscape::Form->new();
my $FormText = $Form->start_form (name => 'FormName', method  => 'post',)
             . $Form->input_text (name => 'InputName', value => '',
                                  size => '', maxlength => '',
                                  default   => '')
             . $Form->submit (name => 'Action', value => 'Go')
             . $Form->end_form;

new

Synopsis

my $Form = Maxscape::Form->new( $CGI );

Description

Creates a new Maxscape::Form object.

start_form

Synopsis

my $startFormText = $Form->start_form (
     name    => 'FormName',
     class   => 'ClassName', # css class
     id      => 'ID',        # css id
     style   => 'Style',     # css style
     method  => 'post',      # get, post.
     target  => ''           # _self, _parent, _top.
     action  => '',          # e.g. '/'.
     enctype => 'multipart', # multipart/form-data

);

Description

Starts an HTML form.

end_form

Synopsis

my $endFormText = $Form->end_form();

Description

Returns the end tag of an HTML form.

State

Synopsis

my $State = $Form->State ( [ $State ] );

Description

Returns or sets the state of a form. Interacts with $self->{CGI}->{FormState}

setState

Synopsis

my $State = $Form->setState();
my $State = $Form->setState('initial', 'MyFormState');

Description

Return a HTML 'hidden' field.

Me

Synopsis

my $MyPageAsHiddenFields = $Form->Me( $Page->Category, $Page->Name );

Description

Outputs the taken category and page name parameters as hidden fields.

MyPage

Synopsis

my $MyPageAsHiddenFields = $Form->MyPage($Page);

Description

Outputs the taken category and page name parameters as hidden fields.

anchor

Synopsis

my $AnchorText = $Form->anchor($HREF, $Text, $otherAttributes);

Description

Returns an HTML anchor.

Examples

my $AnchorText = $Form->anchor('/www.fcg?Category=/foo', 'Hey there');

simple_input_text

Synopsis

my $inputText = $Form->simple_input_text (%P);

Description

Returns an HTML input tag of type text. Same as the text method.

text

Synopsis

my $inputText = $Form->text (name => $Name, attribute => $Attribute,
                             value => $Value, class => $CSS_Class,);

Description

Returns an HTML 'input' tag of type 'text'. Dericiated, better use the simple_input_text method.

input_text

Synopsis

my $Text = $Form->input_text(name         => '',
                             value        => '',
                             size         => '',
                             maxlength    => '',
                             default      => '' ,
                             style        => '',
                             attributes   => '',
                             EventHandler => '',
);

Description

Returns an HTML 'input' tag of type 'text'.

reset

Synopsis

$Text = $Form->reset(value => 'Label', $Javascript);

Description

Returns an HTML 'input' tag of type 'reset'.

Examples




button

Synopsis

$Text = $Form->button ();

Description

Returns an HTML 'button' tag of type 'reset'.

Examples




password

Synopsis

my $Text = $Form->password (name      => '',
                            value     => '',
                            size      => '',
                            maxlength => '',
                            default   => '' 
);

Description

Returns an HTML 'input' tag of type 'password'.

${::TEXTAREA}

Synopsis

my $TextAreaField = $Form->${::TEXTAREA} (name  => '',
                                     value => '',
                                     rows  => '',
                                     cols  => '',
                                     wrap  => '',  # wrap := on|off
                                     style  => '',
                                     class  => '',
);

Description

Returns an HTML form '${::TEXTAREA}' tag.

select

Synopsis

my $PopupText = $Form->select (name     => 'Menu',
                               values   => [1,2,3,4,5],
                               size     => 10,
                               selected => [1,3],
                               multiple => 1,
                               handler  => 'onchange='
 . '"alert(this.form.Menu.options[this.form.Menu.selectedIndex].value)"',
);

Description

Return an HTML 'select' field with its options tags.

Examples

my @ValueList = split (/;/, ${$ElementAttribute}{values});

my $default = $self->{CGI}->Query(${$ElementAttribute}{name});
$default || ($default = $ValueList[0]);

my $PopupText = $Form->select (name     => 'PopupMenu',
                               values   => \@ValueList,
                               selected => $self->{foo}
);

popup_menu

Synopsis

my $PopupText = $Form->popup_menu (name    => 'Window.PopupMenu',
                                   values  => [1,2,3,4,5],
                                   default => $self->{foo}
);

Examples

my @ValueList = split (/;/, ${$ElementAttribute}{values});

my $default = $self->{CGI}->Query(${$ElementAttribute}{name});
$default || ($default = $ValueList[0]);

my $PopupText = $Form->popup_menu (name    => 'Window.PopupMenu',
                                   values  => \@ValueList ,
                                   default => $self->{foo}
);

Description

Return an HTML 'select' field with its options.

checkbox

Synopsis

my $CheckBoxText = $Form->checkbox (
                              name           => '',
                              value          => '',
                              select         => '',
                              checked        => '', # "" || (1 || " checked")
# Max-remove:                              QuoteValueChar => ''
);

Description

Return an HTML 'input' tag of type 'checkbox'.

checkbox_group

Synopsis

my @Values = split (',', $Values);
my $CheckBoxText = $Form->checkbox_group(
                              name    => 'my_name',
                              values  => \@Values,
                              values_text => {Likeminded => 'Likeminded Groups', },
                              checked => '', 
                              header  => '',
                              trailor => '',
);

Description

Returns a group of HTML 'input' tags of type 'checkbox'.

radio

Synopsis

my $RadioBoxText = $Form->radio (name           => '',
                                 value         => '',
                                 values         => '',
                                 select         => 'Selected',
                                 selectCheckedByValue => "$CGI->{Object}",
);

Description

Returns a group of HTML 'input' tags of type 'radio'.

Examples

$FormText = $Form->radio (name           => 'my',
                          values         => \@Values,
                          values_text => {1 => 'Likeminded Groups', },
                          checked        => '2',
                          separator      => '
', )

submit

Synopsis

my $SubmitButton = $Form->submit (name => '', value => '');

Description

Returns a HTML 'input' tag of type 'submit'.

image_button

Synopsis

my $ImageButton = $Form->image_button ( %P );

Description

Returns a HTML 'input' tag of type 'image', say an image button.

Examples

my $Button = $Form->image_button(name   => 'SearchSubmitAction',
                                 src    => '/Images/forward.gif',
                                 width  => "22",
                                 height => "22");

hidden

Synopsis

my $HiddenText = $Form->hidden (name => '', value => '', default => '',);

Description

Returns a HTML 'input' tag of type 'hidden'.

hidden_text

Synopsis

my $HiddenText = $Form->hidden (name => '', value => '', default => '',);

Description

Returns a HTML 'input' tag of type 'hidden'.

formated_text

Synopsis

my $Text = $Form->formated_text (value   => 'bla');

Description

filefield

Synopsis

my $submit = $Form->filefield (name      =>''
                               value     => '',
                               default   => '',
                               size      => '',
                               maxlength => '',
);

Description

Returns a HTML 'input' tag of type 'file'.

FileUploadForm

Synopsis

my $Text = $Form->FileUploadForm (name      => 'filename',
                    filename  => '',
                    #Action    => 'import', # 'import' is default
                    context   =>
                      qq(),
                    Category  => '',
                    Page      => '',
                    value     => '',
                    size      => 10,        # 50 is default
                    maxlength => '80'       # 255 is default
                    default   => ''         # / is default
);

Description

Return an HTML form to upload files.

submitBar

Synopsis

my $submitBarText = $Form->submitBar (name => 'Action', values => @Actions);

Description

Return a button bar of buttons.

Examples

my @Actions = ('edit:Document;Elements;Templates;');
my $submitBarText = $Form->submitBar ( name   => 'Action',
                                       values => @Actions,
                                       CGI    => $CGI,
                                       ButtonSeperator => $::SP
   );

FormElementToHTML

Synopsis

my $FormElement = $Form->FormElementToHTML($CGI->{value}, $ElementAttribute);
# $ElementAttribute is hashref
);

Description

Calls a Maxscape::Form member function by its 'Type'.

FormSelectGroupWidget

Synopsis

$Text .= $self->{Form}->FormSelectGroupWidget(
                          #Type := 'hidden', 'radio', 'checkbox' is default
                          Type            => $WidgetType,
                          value           => $Value,
                          select          => $selected
                          NoHeaderTrailor => ($Type eq 'hidden'),
); 

Description

Calls a Maxscape::Form member function by its 'Type'.

start_table

Synopsis

$Text .= $Page->{Form}->start_table (); 

Description

Outputs an HTML table tag.

end_table

Synopsis

$Text .= $Page->{Form}->end_table (); 

Description

Outputs an HTML end table tag.

start_tr

Synopsis

$Text .= $Page->{Form}->start_tr (); 

Description

Outputs an HTML tr tag.

end_tr

Synopsis

$Text .= $Page->{Form}->end_tr (); 

Description

Outputs an HTML tr end tag.

start_td

Synopsis

$Text .= $Page->{Form}->start_td (); 

Description

Outputs an HTML td tag.

end_td

Synopsis

$Text .= $Page->{Form}->end_td (); 

Description

Outputs an HTML td end tag.


nextprevioustopbecome a membercontact © Maxscape