Reputation: 3729
I am trying to change the error message of the required field, as of now it is showing common error message for all the fields.
But I would like to have different message for each field.
I have tried with localizations, but unable to set the configuration for each field. The one below set the same message for all the fields.
<LocalizedString ElementType="UxElement" StringId="required_field">Value is required.</LocalizedString>
Can you please suggest a way to handle this scenario in the AD B2C custom policy?
Or is there anything I can do with jQuery in the Custom HTML templates to change the error message?
Upvotes: 0
Views: 1510
Reputation: 21
You need to upgrade pagelayout(DataUri)
version to latest version.
<ContentDefinition Id="api.localaccountsignup">
<LoadUri>https://example.com/selfAsserted.html</LoadUri>
<RecoveryUri>~/common/default_page_error.html</RecoveryUri>
<DataUri>urn:com:microsoft:aad:b2c:elements:contract:selfasserted:2.1.26</DataUri>
<Metadata>
<Item Key="DisplayName">Local account sign up page</Item>
</Metadata>
</ContentDefinition>
Then required_field_descriptive
can be used for localisation.
Upvotes: 0
Reputation: 11345
<LocalizedString ElementType="ErrorMessage" StringId="UserMessageIfMissingRequiredElement">Missing required element: {0}</LocalizedString>
{0} will dynamically use the claim display name.
"error_requiredFieldMissing”
can be used in addition.
Upvotes: 1