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.

Change Mandatory of all fields of subform

Avatar

Level 1

Hello,

Im working with the ES2 designer and trying to make the subform hidden and the elements of the subform which are mandatory = "error" to mandatory="visible" here is my sample:

the action is performed on a checkbox click

if(this.rawValue==1) {
    BADO_T1_3_b.presence = "hidden";
    for(var j=0;j<BADO_T1_3_Form.all.length;j++) {
        BADO_T1_3_Form.all.item(j).presence = "hidden";
        for(var i=0; i<BADO_T1_3_Form.all.item(j).nodes.length;i++) {
            BADO_T1_3_Form.all.item(j).nodes.item(i).mandatory = "disabled";
        }
    }
    xfa.host.setFocus("Formular1.#subform[7].BADO_T1_5_a");
}
else {
    BADO_T1_3_b.presence = "visible";
    BADO_T1_3_b.rawValue = 2;
    for(var j=0;j<BADO_T1_3_Form.all.length;j++) {
        BADO_T1_3_Form.all.item(j).presence = "visible";
        for(var i=0; i<BADO_T1_3_Form.all.item(j).nodes.length;i++) {
            BADO_T1_3_Form.all.item(j).nodes.item(i).mandatory = "error";
        }
    }
}

that works the subform gets hidden but after I want to submit the form I get an error that required fields are not filled

I created the subform on more than one page because I want to loop trought the subforms instead of working with every subform seperate

How to implement that to make all elements of a subform mandatory = "disabled"

2 Replies

Avatar

Level 10

Can you post your form to LiveCycle9@gmail.com so I can have a look at it..

Thanks

Srini