Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using checkbox to hide/show values

Status
Not open for further replies.

gem28

Instructor
Nov 5, 2001
64
PH
Hi!
I've been trying to create a formula that will hide text fields when values in a checkbox is selected.

The checkbox field contains 4 items. Each item corresponds to a text field. When items in the checkbox are selected, the corresponding text fields should display otherwise it should be hidden.

I used the formula below in the Hide-When box:
@If(@Contains (confidential;"A";"B";"C";"D") = 1; @False; @True)

The problem with it tho, is that when I select one of the items, all text fields get displayed.

Truly appreciate the help. Thanks!

Tin
 
First of all, if your text fields are on the same line, this won't work. If you have to present the fields on a single line, you'll have to create a table with 4 cells and put one field per cell.

Second, for a checkbox field (or radio button, or dialog box), if you want the document to react dynamically, you have to activate (in the field properties) the "refresh fields on keyword change" option in the second tab of the field properties dialog box.

Last, but not least, you will need one Hide/When per field :
Code:
@If(@Contains(confidential;"A");@true;@false)

Hope this helps !

Pascal.


I've got nothing to hide, and I'd very much like to keep that away from prying eyes.
 
Thanks Pascal!

The program is working now. I was able to get an idea from the formula you suggested but I twicked it a little more.

It was not working while pointing at the checkbox itself so I created a computed text field with multiple values property. This field points at the checkbox field then hid it.

As for the text field, I made it point to the new computed field and used this formula:
@If(!@Contains (conf;"1");@True; @False)

Thanks so much for tirelessly helping! God bless!

tin
 
Always happy to be of use !

:)


I've got nothing to hide, and I'd very much like to keep that away from prying eyes.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top