Quantcast
Channel: Adobe Community : All Content - LiveCycle Designer
Viewing all articles
Browse latest Browse all 5571

If else in checkbox in table not working correctly

$
0
0

I'm new in this forum and hope someone would be able to assist me on this.

 

I have created a dynamic table and I have 2 types of check boxes.

One is a check box for individual rows that populates a value in a cell. Else, it will be zero value.

Another is a master check box that enables all the rows' check box and value

 

Problem statement:

When I click the master check box, all the individual check box is enabled. However, the value of the cell is incorrect. All the rows' value is based on the first row's value.

 

Below is my code:

Master Checkbox (using formcal in click):

if(CheckBoxAll == "1")then

Table.Row1[*].CheckBox1="1";

Table.Row1[*].Cell4=Table.Row1[*].Cell2;

else

Table.Row1[*].CheckBox1="0";

Table.Row1[*].Cell4=0;

endif

 

Individual row's checkbox (using formcal in click):

if(CheckBox1 == "1")then

Cell4=Cell2

else

Cell4=0

endif

 

Alternatively, i tried disabling the value population from the master checkbox & put a validation in each row instead. This time, It works! but it kept prompting a message for each rows whenever I unchecked the box: "The value you entered for Checkbox1 is invalid".

 

Below is my code:

Master Checkbox (using formcal in click):

if(CheckBoxAll == "1")then

Table.Row1[*].CheckBox1="1";

else

Table.Row1[*].CheckBox1="0";

endif

 

Individual row's checkbox (using formcal in validate event):

if(CheckBox1 == "1")then

Cell4=Cell2

else

Cell4=0

endif

 

Greatly appreciate any help as I'm at a loss as to why tis error occurs and how to solve it.

 

Thank you!


Viewing all articles
Browse latest Browse all 5571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>