summaryrefslogtreecommitdiff
path: root/httemplate/elements/tr-input-text.html
blob: c8bec5ea6704ec21fcb64435c8306ffc9f181ed9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<% include('tr-td-label.html', @_ ) %>

  <TD <% $style %>>

    <% $opt{'prefix'} %><INPUT TYPE  = "<% $opt{type} || 'text' %>"
                               NAME  = "<% $opt{field} %>"
                               ID    = "<% $opt{id} %>"
                               VALUE = "<% $value |h %>"
                               <% $size %>
                               <% $maxlength %>
                               <% $align %>
                               <% $onchange %>
                        ><% $opt{'postfix'} %>

  </TD>

</TR>

<%init>

my %opt = @_;

my $value = length($opt{curr_value}) ? $opt{curr_value} : $opt{value};

my $onchange = $opt{'onchange'}
                 ? 'onChange="'. $opt{'onchange'}. '(this)"'
                 : '';

my $size = $opt{'size'}
             ? 'SIZE="'. $opt{'size'}. '"'
             : '';

my $maxlength = $opt{'maxlength'}
                ? 'MAXLENGTH="'. $opt{'maxlength'}. '"'
                : '';

my $align = $opt{'text-align'}
                ? 'STYLE="text-align: '. $opt{'text-align'}. '"'
                : '';


my $style = $opt{'cell_style'} ? 'STYLE="'. $opt{'cell_style'}. '"' : '';

</%init>