Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Checkboxes control appearance of numeric fields when two or more checkboxes are checked

Avatar

Avatar
Level 2
Niederfuchs
Level 2

Likes

0 likes

Total Posts

10 posts

Correct Reply

0 solutions
View profile

Avatar
Level 2
Niederfuchs
Level 2

Likes

0 likes

Total Posts

10 posts

Correct Reply

0 solutions
View profile
Niederfuchs
Level 2

26-08-2008

Dear friends

I have a problem including checkboxes, numeric fields and variables



Task:

There are five checkboxes to be checked by the user (let's name them 1,2,3,4,5)

Combined with the checkboxes there are 5 numericFields and 1 Textbox (let's name them A,B,C,D,E and T)

The following has to be scripted!

If two or more checkboxes are checked the textbox (T) plus the corresponding numericField (1-A; 2-B; 3-C; 4-D; 5-E) has to appear

If only one checkbox (or no checkbox) has been checked - none of the numericFields or the Textbox is supposed to be visible.



Idea:

I tried to introduce a variable connected to the form:ready event of the first checkbox:



Formular1.superframe.general.primarylevel::ready:form - (FormCalc, client)

var schooleducationlevelcounter=0



I set the Textbox and the five numericfields to invisible then on the exit event of each of the five checkboxes - I tried to increment the variable and have the script check whether or not the variable has become greater than 1 - if that was the case the script is supposed to set the correwsponding numericField to visible:

This script looks like this (it is probably ridiculously wrong - however I am supernew to Javascripting...)

(By the way is the rawValue of a checked checkbox "1" - and of an unchecked checkbox "0" ?!?!?)



Formular1.superframe.general.primarylevel::exit - (JavaScript, client)

if (xfa.form.Formular1.superframe.general.primarylevel.rawValue==1)

{

++schooleducationlevelcounter

}

if (schooleducationlevelcounter>1)

{

xfa.form.Formular1.superframe.administrator.totalcompschoolform.presence = "visible"

}



I hope you can help me out...