使用为该字段定义的无效模式在width: 100%
旅程步骤输入密码会导致在表单的输入部分上方显示以下错误消息:
[密码]
的模式不正确
有没有办法配置此错误消息,以使其更加用户友好?
答案 0 :(得分:2)
Yes but that message can be used for multiple fields.
See this guide: Azure Active Directory B2C: Using language customization.
答案 1 :(得分:2)
感谢spottedmahn提供有关语言自定义的信息。当我使用自定义B2C策略时,我无法通过Azure门户编辑语言功能。
我发现WingTipGames示例中的this policy显示了如何实现我想要的目标。
我在ContentDefinition中添加了LocalizedResourceReference,如下所示:
<ContentDefinition Id="api.combinedsignupsignin">
<LoadUri>https://www.mywebsite.net/login</LoadUri>
<RecoveryUri>~/common/default_page_error.html</RecoveryUri>
<DataUri>urn:com:microsoft:aad:b2c:elements:unifiedssp:1.1.0</DataUri>
<Metadata>
<Item Key="DisplayName">Signin and Signup</Item>
</Metadata>
<LocalizedResourcesReferences MergeBehavior="Prepend">
<LocalizedResourcesReference Language="en" Url="https://mywebsite.net" LocalizedResourcesReferenceId="api.combinedsignupsignin.en" />
</LocalizedResourcesReferences>
</ContentDefinition>
然后我在BuildingBlocks中添加了以下Localization部分:
<Localization Enabled="true">
<SupportedLanguages DefaultLanguage="en" MergeBehavior="ReplaceAll">
<SupportedLanguage>en</SupportedLanguage>
</SupportedLanguages>
<LocalizedResources Id="api.combinedsignupsignin.en">
<LocalizedStrings>
<LocalizedString ElementType="ErrorMessage" StringId="UserMessageIfIncorrectPattern">Please enter a valid password</LocalizedString>
</LocalizedStrings>
</LocalizedResources>
</Localization>
这导致我在屏幕上收到所需的错误消息:
&#34;请输入有效密码&#34;