$htmlForm->setModifiedUser( $user );
$htmlForm->setId( 'mw-prefs-form' );
+ $htmlForm->setAutocomplete( 'off' );
$htmlForm->setSubmitText( $context->msg( 'saveprefs' )->text() );
# Used message keys: 'accesskey-preferences-save', 'tooltip-preferences-save'
$htmlForm->setSubmitTooltip( 'preferences-save' );
*/
protected $mAction = false;
+ /**
+ * Form attribute autocomplete. false does not set the attribute
+ * @since 1.27
+ * @var bool|string
+ */
+ protected $mAutocomplete = false;
+
protected $mUseMultipart = false;
protected $mHiddenFields = [];
protected $mButtons = [];
if ( !empty( $this->mId ) ) {
$attribs['id'] = $this->mId;
}
+ if ( !empty( $this->mAutocomplete ) ) {
+ $attribs['autocomplete'] = $this->mAutocomplete;
+ }
return $attribs;
}
return $this->getTitle()->getLocalURL();
}
+
+ /**
+ * Set the value for the autocomplete attribute of the form.
+ * When set to false (which is the default state), the attribute get not set.
+ *
+ * @since 1.27
+ *
+ * @param string|bool $autocomplete
+ *
+ * @return HTMLForm $this for chaining calls
+ */
+ public function setAutocomplete( $autocomplete ) {
+ $this->mAutocomplete = $autocomplete;
+
+ return $this;
+ }
}