Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session

Drop Down Menu that controls Active/Inactive column

Avatar

Level 1

I have a drop down menu on a template form with an expandable table (depending on the number of rows you type in a numeric box) and I want the drop down options to control the fields of a column.  Make the column fields active or inactive depending on the selection of the dropdown menu.  The drop down menu on the form is on the upper right corner named "TYPE OF GRANT" (that consists only of two options "New" and "Continuation".  Depending on the selection the very first column on the template should become active or inactive including the header.

When I select "NEW" from the "TYPE OF GRANT" dropdown options, I want the fields in the first column to become active.  Right now when I select "New" the header of the column--APPLICATION NUMBER--shows up but the fields are inactive (the fields should be active text fields.  (see image below first column)

New.JPG

When I select "CONTINUATION" everything including the header of the first column should be inactive, which seems to work.

(see image below, first column)

Continuation.JPG

If you can help me it will be great! again thank you so much for your help.

1 Reply

Avatar

Level 7

Hi,

The DropDownList change code should just need to specify what is selected and then execute code based on the selection.

DropDownList1: Change

if ($.boundItem(xfa.event.newText) == "New") {
  oTargetField = this.resolveNode("Table1.Row1.TextField");
   oTargetField.access = "readOnly";
}

if ($.boundItem(xfa.event.newText) == "Continuation") {
  oTargetField = this.resolveNode("Table1.Row1.TextField");
   oTargetField.access = "open";
}

This code does only do the first cell in the first column. You could use an if code to handle other rows, but you might want to add a maximum number of rows (so you dont have to repeatedly write so much code).