Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Check all required forms on a page, then check checkbox

Avatar

Former Community Member
I was wondering how i can do the following.



b I got the following:

I got a PDF document with different pages (about 16 pages). On every page are required and non-required fields. In the Master Page i've made a sidepanel with pagetitles. Each pagetitle has his own checkbox next to it.



b I want do the following:

I wanna check on every page individually if the required fields are filled in. When the required fields are filled in, then check on the checkbox at the pagetitle belonging to the page you filled in. If not, check off the checkbox.



I'm searching for days now on the whole internet, but i can't find any information to do this.



Hopefully you can help me with this.



thank you
4 Replies

Avatar

Level 6
Rob,



Use the execValidate function from the context of the subform that you're checking. So, if your form is called "form1" and the subform you want to check is "Page1", this JavaScript will return "true" if all validations for objects on that subform are successful. This includes mandatory fields.



xfa.form.form1.Page1.execValidate());



Jared

Avatar

Former Community Member
I don't think i understand it well :(



I got the following:



My checkbox:

form1.#pageSet[0].Page1.Subform1.CheckBox1[0]::validate: - (JavaScript, client)



code:

if (xfa.form1.#subform[2].page1.execValidate() returns true){

form1.#pageSet[0].Page1.Subform1.CheckBox1[0].rawValue = 1;}

else {

form1.#pageSet[0].Page1.Subform1.CheckBox1[0].rawValue = 0;}



I want that if that all required fields on page 1 returns true the checkbox will be checked.



(I'm a newbie to Livecycle/javascript)