Debian Codegraph @

Embperl/Form/Control/submit.pm

raw
1
2 ###################################################################################
3 #
4 # Embperl - Copyright (c) 1997-2008 Gerald Richter / ecos gmbh www.ecos.de
5 # Embperl - Copyright (c) 2008-2014 Gerald Richter
6 #
7 # You may distribute under the terms of either the GNU General Public
8 # License or the Artistic License, as specified in the Perl README file.
9 #
10 # THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
11 # IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
12 # WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13 #
14 # $Id$
15 #
16 ###################################################################################
17
18 package Embperl::Form::Control::submit ;
19
20 use strict ;
21 use base 'Embperl::Form::Control' ;
22
23 use Embperl::Inline ;
24
25 1 ;
26
27 __EMBPERL__
28
29 [# ---------------------------------------------------------------------------
30 #
31 # show - output the control
32 #]
33
34 [$ sub show ($self, $data)
35
36 my $span = ($self->{width_percent}) ;
37 $]
38 <td class="cBase cControlBox cControlButtonBox" colspan="[+ $span +]">
39 <input class="cBase cControl cControlButton" name="[+ $self->{name} +]"
40 value="[+ $self->{value} || $self->{text} +]"
41 title="[+ $self->{text} +]"
42 [$if $self -> {novalidate} $] onClick="doValidate = 0;" [$endif$]
43 [$if $self -> {image} $]
44 type="image" src="[+ $self -> {image} +]"
45 [$else$]
46 type="submit"
47 [$endif$]
48 >
49 </td>
50 [$endsub$]
51
52 __END__
53
54 =pod
55
56 =head1 NAME
57
58 Embperl::Form::Control::submit - A submit button inside an Embperl Form
59
60
61 =head1 SYNOPSIS
62
63 {
64 type => 'submit',
65 text => 'send',
66 name => 'foo',
67 value => 'xxx',
68 image => 'xxx',
69 }
70
71 =head1 DESCRIPTION
72
73 Used to create an submit control inside an Embperl Form.
74 If an image is given it will create an image button.
75 See Embperl::Form on how to specify parameters.
76
77 =head2 PARAMETER
78
79 =head3 type
80
81 Needs to be 'submit'
82
83 =head3 name
84
85 Name of the button
86
87 =head3 text
88
89 Will be used as label for the submit button or tool tip
90 in case of an image button
91
92 =head3 value
93
94 Gives the value to send
95
96 =head3 image
97
98 URL of an image. If given an image button will be created,
99 if absent, an normal submit button will be created.
100
101
102 =head1 Author
103
104 G. Richter (richter at embperl dot org)
105
106 =head1 See Also
107
108 perl(1), Embperl, Embperl::Form
109
110