我有一个用Symfony2制作的表格:
->add('password', 'repeated', array('data' => '', 'label' => 'Repeat New Password', 'type' => 'password', 'required' => false,
'first_options' => array('data' => '', 'label' => 'New password', 'always_empty' => true),
'second_options' => array('label' => 'Repeat new password'),
但在Chrome中,浏览器会尝试自动填写新密码字段。
我该如何避免这种情况?
感谢。
答案 0 :(得分:6)
试试这个:
->add('password', 'repeated', array('data' => '', 'label' => 'Repeat New Password', 'type' => 'password', 'required' => false,
'first_options' => array('attr' => array("autocomplete" => "off")),
'second_options' => array('attr' => array("autocomplete" => "off")),