%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC
%# <sales@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
%#
%# END BPS TAGGED BLOCK }}}
<%DOC>
-see docs/using_forms_widgets.pod
+see docs/extending/using_forms_widgets.pod
</%DOC>
<div id="form-box-<% lc $Name %>" class="widget">
<span class="label description"><% $Description %></span>
<span class="hints"><% $Hints %></span>
</div>
<%INIT>
+$_ = '' foreach grep !defined, $CurrentValue, $DefaultValue;
+$DefaultLabel ||= loc( 'Default: [_1]', $DefaultValue );
</%INIT>
<%ARGS>
$Name
$Default => 0,
$DefaultValue => 0,
-$DefaultLabel => loc( 'Default: [_1]', $DefaultValue ),
+$DefaultLabel => undef
</%ARGS>
<%METHOD InputOnly>
-<input type="text" name="<% $Name %>" value="<% $CurrentValue || '' %>" />\
+<input type="text" name="<% $Name %>" value="<% $CurrentValue %>" />\
<%ARGS>
$Name
$CurrentValue => '',
</%ARGS>
+<%INIT>
+$CurrentValue = '' unless defined $CurrentValue;
+</%INIT>
</%METHOD>
<%METHOD Process>