Issue
My customer connexion form has a password field which contains pattern=".{5,}"
. Since it's not a registration form, I would want to remove this HTML attribute.
Thus, I opened classes/form/CustomerLoginForm.php and I saw a FormFormatterInterface
was used here: classes/form/CustomerLoginFormatter.php.
The latter contains:
public function getFormat()
{
return [
[...],
'password' => (new FormField)
->setName('password')
->setType('password')
->setRequired(true)
->setLabel($this->translator->trans(
'Password', [], 'Shop.Forms.Labels'
))
->addConstraint('isPasswd'),
];
}
No line specify this HTML pattern
attribute.
Where could I remove it? Should I write some setter or add some constraint in the above code? (in an override of course)
Solution
You can remove that pattern from the file: /themes/classic/templates/_partials/form-fields.tpl
Search for this line and remove or change as your needs: pattern=".{literal}{{/literal}5,{literal}}{/literal}"
Answered By - Rolige Answer Checked By - Senaida (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.