X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Finput-text.html;fp=httemplate%2Felements%2Finput-text.html;h=9db064348849ff6575d5770a11b619221858d537;hb=9c7dee35f91a386fcce14cb6c3e9d23ba3eee8af;hp=0000000000000000000000000000000000000000;hpb=a1871d3d13c1dafa93b956762c0d23728d261da7;p=freeside.git diff --git a/httemplate/elements/input-text.html b/httemplate/elements/input-text.html new file mode 100644 index 000000000..9db064348 --- /dev/null +++ b/httemplate/elements/input-text.html @@ -0,0 +1,44 @@ +<% $opt{'prefix'} %> + <% $maxlength %> + <% $style %> + <% $opt{disabled} %> + <% $onchange %> + ><% $opt{'postfix'} %> +<%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'}. '"' + : ''; + +$opt{'disabled'} = &{ $opt{'disabled'} }( \%opt ) + if ref($opt{'disabled'}) eq 'CODE'; +$opt{'disabled'} = 'DISABLED' + if $opt{'disabled'} && $opt{'disabled'} !~ /disabled/i; # uuh... yeah? + +my @style = (); + +push @style, 'text-align: '. $opt{'text-align'} + if $opt{'text-align'}; + +push @style, 'background-color: #dddddd' + if $opt{'disabled'}; + +my $style = scalar(@style) ? 'STYLE="'. join(';', @style). '"' : ''; + +