Programatically hide a section

C

Cristina

Hello,

I am trying to programatically set pagebreaks for an infopath form. In my
code I am counting the lines from various rich text boxes. In the form I have
placed 3 pagebreaks. (checkbox and section that contains a pagebreak. On the
section there is a rule: if checkbox = false hide section).

In the code I wrote (it triggers when i click a button):
suma1 = CountLines(datepetent) + CountLines(dateteren1) +
CountLines(dateteren2) + CountLines(regimjuridic) + CountLines(regimeconomic)
+ CountLines(regimtehnic) + CountLines(scop);
if (suma1>34){
pagebr3.text = 1;
}
else {
pagebr3.text = 0;
}
CountLines is a function that counts the lines in a text box.
The code works, but there is a problem when sum1>=35. It puts the pagebreak,
but when I delete some lines and click the button again, the checkbox =
false, but the section with the page break is still active.

Is there a way to set the hidden property of a section using Jscript?
Is there another way to set programatically pagebreaks?

Thank you,
Cristina
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top