ZF2-391: formInput translates attribute autocomplete="off" into audocomplete="on"

Issue Type: Bug Created: 2012-07-10T14:39:42.000+0000 Last Updated: 2012-07-12T10:28:50.000+0000 Status: Resolved Fix version(s): Reporter: Yonni Mendes (yonman) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend\Form

  • FormElement
  • formInput

Related issues: Attachments:


Steps: Create a form using the factory Add a field with attribute autocomplete with a string value of "off" Render the field

<pre class="highlight">$this->add(array(
    'name' => 'field',
    'attributes' => array(
        'type' => 'text',
        'autocomplete' => 'off',

Expected result:

<pre class="highlight">

Actual result:

The "correct" way of using this field is by specifying autocomplete => false However, this discrepancy with other "text-ish" attributes is confusing to use.


Posted by Chris Martin (cgmartin) on 2012-07-10T18:02:49.000+0000

Added a PR for ability to use boolean values or raw values (ie "off") depending on the type of value set (boolean or not):

My preference is to use the boolean type values (I can never remember if I should use "autocomplete" or "on" as the value), but I agree about adding support for those who'd like to use the raw values.

Posted by Maks 3w (maks3w) on 2012-07-12T10:28:50.000+0000

Patch is merged

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.