3

I am using Sitecore 9 Forms with a default mandatory (required field) validation. While submitting the form it is showing some validation message.

Is it possible alter that message?

4

The code for the required field validation works in a different way than other validations and the message will come from the Sitecore dictionary. If you want to update or translate it, you need to add a key to that Dictionary.

This can be done in the master database - just add an item in the /system/Dictionary - the name doesn't really matter. The key however needs to be exactly "{0} is required.". The phrase can be anything you want, just remember to add the {0} token as that will be replaced by your field name.

enter image description here

More info: https://ggullentops.blogspot.com/2017/10/sitecore-9-forms-translating-error.html

Note that the dictionary item does not exist in a default setup (a fallback is used in the code to give you a message when it is missing). So you actually need to create a new one.

  • Message is showing without dictionary, i don't have any dictionary item(required item) in my local. i think its coming from other item. if i added dictionary item ,how we have map to the form, Is there any other way find this. – PKH Jan 22 '19 at 18:46
  • The default is a fallback message from the code, so it's normal that you don't see an item. You need to create it. If the key is correct, Forms will use it. You don't need to map it to any form - it is used for all forms. – Gatogordo Jan 22 '19 at 18:49
  • i applied in this way. its working for me. thanks for sharing. – PKH Jan 22 '19 at 18:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.