omer_rasheed
New Creator

Validation Message For Input ShowAcquireDocument

Jump to solution

How can I provide validation messages on ShowAcquireDocument?

 

I have tried to use PostInputContext ValidationErrorFields but not successful. Please guide me on it.

0 Kudos
1 Solution

Accepted Solutions
MarcusEdwards
Crownpeak (Retired)

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:

Screenshot 2020-07-24 at 16.00.34.png

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.");

 

View solution in original post

0 Kudos
2 Replies
MarcusEdwards
Crownpeak (Retired)

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:

Screenshot 2020-07-24 at 16.00.34.png

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.");

 

0 Kudos

Thank You.

0 Kudos