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 box only visible when data is entered in two other fields

Avatar

Level 3

My form has a table in which one column's cells are check boxes. I would like the check boxes to be only visible when both the quantity and unit price cells are filled out.

If I use the following script to hide the checkbox, it becomes my Amount??? which is the column right next to it.

taxable.presence = "hidden";

I am putting the script in the initialize event of the table.

2 Replies

Avatar

Level 10

The initialize event only fires once the form is opend, not afterwards when the fields values are changed.

You need another event such as layoutReady.

this.presence = !Quantity.isNull && !UnitPrice.isNull ? "visible" : "hidden";

Avatar

Level 3

Thanks for the pointer. I tried your script in the layoutReady event of the cell but I get the same behavior as before. The cell is initialy hidden, but when I enter data in quantity and unitPrice, the checkbox cell behaves like the Amount cell ( qty * price).