Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

ADOBE Reader Error

Avatar

Former Community Member

Hi,

I have a form created in LC ES. all the fields in the form are required and have been set so using script. Many of the fields in the form are made hidden depending on user selection. When I make a certain required field hidden, I get a ADOBE Reader pop-up window, saying "'field name': cannot be left blank." I have not set any error messages for the fields. I have a similar form and tat works well and does not show any ADOBE Reader error messages. Please help.

Regards,

Nakul

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

No it won't ...only the submit will do that .....OK Now i understand.

The issue is that you cannot update that flag while your code is running. Instead of testing that flag I woudl use the form1.execValidate() . This will returna true/false value based on whether there were validation errors or not. If there are no validation errors then execute the submit.

if (form1.execValidate() == true){

     var mailMsg = "Here is a completed SEAR, submitted for field supevisor review and approval.";

     var oDoc = event.target;

     oDoc.mailDoc({bUI

: true,cTo: "",cCC: "",cSubject: "Approval for Speaking Engagement Approval Request (SEAR)",cMsg: mailMsg});

}

Paul

View solution in original post

13 Replies

Avatar

Level 10

Same dialog appears for me too.

If you find any solution, please share with me.

Nith

Avatar

Level 10

I got the point!

I found the following tag in XML Source of my problematic field. After removing these lines, it works fine.

                  <validate scriptTest="warning">
                     <message>
                        <text name="scriptTest"/>
                     </message>
                  </validate>

I tried to enable Validation Error and then reverted back to None. I think this action doesn't update the XML source, which shows us this dialog.

-Nith

Avatar

Former Community Member

I didn't find an such code in the XML source. The only script the validation tag has is the script I have written for the required field validation, as shown below:

<validate>

<

script contentType="application/x-javascript" runAt="both">

scoForm.AtLeastOne(this);

</

script>

</

validate>

Avatar

Former Community Member

You have made the field required. This means that it must have a value (whether it is visible or not). If you are making objects invisible or hidden make sure that you turn off the mandatory bit of the field as well.

Paul

Avatar

Former Community Member

In the function I am also checking if the field is visible before setiing the validation. Else, I set off the validation.

Avatar

Former Community Member

Then there must be something happening to your script because that error indicates that the field is required. Do you get any errors in the Javascript console?

Paul

Avatar

Former Community Member

https://acrobat.com/#d=i1u1EN2zBFGw59If7lK2ig

I have published the form at the above location. I dont see that message anymore. I just copy pasted the entire form to a new blank form. However, now when I try submitting after filling up all  the values, I get the error "Submit Cancelled".

Avatar

Former Community Member

On the preSubmit event of the button you have code that will check a validation flag. This flag is never getting updated so the submit button never gets pressed. I woudl suggest that you separate the submit button from the button that the user clicks. Make the real submit button invisible and add a fake submit button that is a regular button. You can use the same code that you have on the submit button, but you will have to programmatically hit th ereal submit button after you test the flag. To do that ad this line of code:

Button1.execEvent("click");

Make sure that you remove the code from the real submit.

The error is coming because you have cancelled the submit with your code. This way you are not cancelling the submit but controlling when it is executed.

Make sense?

Paul

Avatar

Former Community Member

Thanks for doing that analysis Paul. However, will a regular submit button do a validation on the form and display the required fields in red? I will anyways try that out and see if it works.

Avatar

Former Community Member

https://acrobat.com/#d=XY14MN0Joqy67o4ox1p0LA

I tried adding the field, but it failed to show up the validations. Also the above form is built in a very similar way but works just fine.

Avatar

Correct answer by
Former Community Member

No it won't ...only the submit will do that .....OK Now i understand.

The issue is that you cannot update that flag while your code is running. Instead of testing that flag I woudl use the form1.execValidate() . This will returna true/false value based on whether there were validation errors or not. If there are no validation errors then execute the submit.

if (form1.execValidate() == true){

     var mailMsg = "Here is a completed SEAR, submitted for field supevisor review and approval.";

     var oDoc = event.target;

     oDoc.mailDoc({bUI

: true,cTo: "",cCC: "",cSubject: "Approval for Speaking Engagement Approval Request (SEAR)",cMsg: mailMsg});

}

Paul

Avatar

Former Community Member

Paul - This was helpful and I am able to submit the form. However, if I do the following, it fails :

- open the form and click the submit button to display all the required fields.

- enter all the required fields and leave empty the new fields that are made visible due to the user selection.

- submit the form.

The mailing window appears with the form attached, even though the required fields that were hidden ar still empty. If the mail window is cancelled, the form shows up with the error message. So it means, the mail happens even before the form is validatied or the validation script is set to false after that in this scenario.

Avatar

Former Community Member

Sorry Paul..it works...my fault..I had removed the script wh

ere I was forcing the form validation. The form seems to be working well now..Thanks for all your help

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----