Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

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