Expand my Community achievements bar.

SOLVED

Check Section for Completeness

Avatar

Former Community Member

Greetings!

I am running LiveCycle ES3 and am trying to do the following on the click event of the "Next" button referenced below.  Basically, I just need to make sure that at least one piece of data is entered into EACH section, then the user can move on, otherwise they get an error message.  I was able to get it to work just fine if NONE of the sections has data.  However, if they have selected, say, one checkbox in section 3a, but left everything else blank, then no message pops up.  They can't continue, which is good, but the "Next" button simply does nothing at that point (I need it to pop up an error message).

WHEN

  the "Next" button is clicked

IF

  (section 3a: none of the five checkboxes is checked AND the text field is empty)

OR

  (section 3b: the text field is empty AND a value in the drop-down list has not been selected)

OR

  (section 3c: the text field is empty)

OR

  (section 3d: the text field is empty)

OR

  (section 3e: none of the six checkboxes is checked AND the text field is empty)

THEN

  pop up an error message

ELSE

  hide section 3

  display section 4

Any help would be appreciated.

Thanks!

1 Accepted Solution

Avatar

Correct answer by
Level 7

in formcalc:

if ((section3a.CheckBox1 == 0 and section3a.CheckBox2 == 0 and section3a.CheckBox3 == 0 and section3a.CheckBox4 == 0 and section3a.CheckBox5 == 0 and section3a.TextField1.isNull) or (section3b.TextField2.isNull and section3b.DropDownList1.isNull) or section3c.TextField3.isNull or section3d.TextField4.isNull or (section3e.CheckBox1 == 0 and section3e.CheckBox2 == 0 and section3e.CheckBox3 == 0 and section3e.CheckBox4 == 0 and section3e.CheckBox5 == 0 and section3e.CheckBox6 == 0 and section3e.TextField1.isNull)) then

xfa.host.messageBox("Error message")

else section3.presence = "hidden"

section4.presence = "visible"

endif

(obviously you will need to rename everything to what you have called them)

View solution in original post

2 Replies

Avatar

Correct answer by
Level 7

in formcalc:

if ((section3a.CheckBox1 == 0 and section3a.CheckBox2 == 0 and section3a.CheckBox3 == 0 and section3a.CheckBox4 == 0 and section3a.CheckBox5 == 0 and section3a.TextField1.isNull) or (section3b.TextField2.isNull and section3b.DropDownList1.isNull) or section3c.TextField3.isNull or section3d.TextField4.isNull or (section3e.CheckBox1 == 0 and section3e.CheckBox2 == 0 and section3e.CheckBox3 == 0 and section3e.CheckBox4 == 0 and section3e.CheckBox5 == 0 and section3e.CheckBox6 == 0 and section3e.TextField1.isNull)) then

xfa.host.messageBox("Error message")

else section3.presence = "hidden"

section4.presence = "visible"

endif

(obviously you will need to rename everything to what you have called them)