forms icon indicating copy to clipboard operation
forms copied to clipboard

Method addEmail: unable to have own rule message for EMAIL

Open Lumeriol opened this issue 5 years ago • 0 comments

Version: 3.0.4+ and probably older

Bug Description

If I define in form $form->addEmail('email', 'E-mail'), there is no option to show errorMessage from method addRule(Form::EMAIL, 'E-mail nemá správný tvar.'), because this rule is set in method and it is not overwritten. Same problem should be for addInteger(), but I don't tested it. For this purposes I must to use addText with rule for e-mails.

Expected Behavior

As I wrote up, have an own error message in rule Email.

Possible Solution

Maybe to have a parameter for errorMessage in addEmail() or remove addRule(Form::EMAIL) from this method.

Lumeriol avatar Jun 18 '20 15:06 Lumeriol