Developers
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
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
Highlighted
Partner Enablement
Partner Enablement

Re: Validation Message For Input ShowAcquireDocument

Jump to solution

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
Highlighted
Partner Enablement
Partner Enablement

Re: Validation Message For Input ShowAcquireDocument

Jump to solution

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
Highlighted
New Creator

Re: Validation Message For Input ShowAcquireDocument

Jump to solution

Thank You.

0 Kudos