[Jifty-commit] r2538 - in jifty/trunk: lib/Jifty/Web/Form

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Sat Jan 20 14:20:48 EST 2007


Author: trs
Date: Sat Jan 20 14:20:47 2007
New Revision: 2538

Modified:
   jifty/trunk/   (props changed)
   jifty/trunk/lib/Jifty/Web/Form/Field.pm

Log:
 r19007 at zot:  tom | 2007-01-20 14:20:37 -0500
 Support for controlling browser-based autocomplete on form fields


Modified: jifty/trunk/lib/Jifty/Web/Form/Field.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Web/Form/Field.pm	(original)
+++ jifty/trunk/lib/Jifty/Web/Form/Field.pm	Sat Jan 20 14:20:47 2007
@@ -104,8 +104,8 @@
 
 =cut
 
-sub accessors { shift->SUPER::accessors(), qw(name label input_name type sticky sticky_value default_value action mandatory ajax_validates ajax_canonicalizes autocompleter preamble hints placeholder focus render_mode length _element_id); }
-__PACKAGE__->mk_accessors(qw(name _label _input_name type sticky sticky_value default_value _action mandatory ajax_validates ajax_canonicalizes autocompleter preamble hints placeholder focus render_mode length _element_id));
+sub accessors { shift->SUPER::accessors(), qw(name label input_name type sticky sticky_value default_value action mandatory ajax_validates ajax_canonicalizes autocompleter preamble hints placeholder focus render_mode length _element_id disable_autocomplete); }
+__PACKAGE__->mk_accessors(qw(name _label _input_name type sticky sticky_value default_value _action mandatory ajax_validates ajax_canonicalizes autocompleter preamble hints placeholder focus render_mode length _element_id disable_autocomplete));
 
 =head2 name [VALUE]
 
@@ -169,6 +169,10 @@
 canonicalized before the action is run, whether or not they also
 C<ajax_canonicalize>
 
+=head2 disable_autocomplete [VALUE]
+
+Gets or sets whether to disable _browser_ autocomplete for this field.
+
 =head2 preamble [VALUE]
 
 Gets or sets the preamble located in front of the field.
@@ -486,6 +490,7 @@
     $field .= qq! value="@{[Jifty->web->escape($self->current_value)]}"! if defined $self->current_value;
     $field .= $self->_widget_class; 
     $field .= qq! size="@{[ $self->length() ]}" maxlength="@{[ $self->length() ]}"! if ($self->length());
+    $field .= qq! autocomplete="off"! if defined $self->disable_autocomplete;
     $field .= " " .$self->other_widget_properties;
     $field .= qq!  />\n!;
     Jifty->web->out($field);


More information about the Jifty-commit mailing list