Search DXM Forum
How can I provide validation messages on ShowAcquireDocument?
I have tried to use PostInputContext ValidationErrorFields but not successful. Please guide me on it.
Using PostInputContext.ValidationErrorFields is absolutely the right way to go. This is the validation result I get when I ran a test with the following code snippets:
input.aspx:
...
Input.ShowAcquireDocument("Hero image", "article_hero");
...
post_input.aspx:
if(!context.InputForm.HasField("article_hero")) {
context.ValidationErrorFields.Add("article_hero", "Please select the asset to link to in the hero display.");
Using PostInputContext.ValidationErrorFields is absolutely the right way to go. This is the validation result I get when I ran a test with the following code snippets:
input.aspx:
...
Input.ShowAcquireDocument("Hero image", "article_hero");
...
post_input.aspx:
if(!context.InputForm.HasField("article_hero")) {
context.ValidationErrorFields.Add("article_hero", "Please select the asset to link to in the hero display.");
Thank You.