Jump to content
Sign in to follow this  
davidnickerson

Hide/Show Checkbox Conditional Formatting

Recommended Posts

Hi,

I'm hoping to divine a way to achieve the following:

If a particular condition is met, a checkbox will be displayed, otherwise, "invisible".

I'm familiar with using conditional formatting to achieve this type of result with text fields, etc., but of course, conditional formatting cannot be applied to the line attributes of a checkbox.

Any ideas?

Thanks!

Share this post


Link to post
Share on other sites

Value is "Empty"?

Share this post


Link to post
Share on other sites

It sounds like you really want to hide a layout element - which can't be done with conditional formatting. Search on the forums for how to hide a field/object.

Share this post


Link to post
Share on other sites

It sounds like you really want to hide a layout element - which can't be done with conditional formatting. Search on the forums for how to hide a field/object.

Thanks. Yes, I'm aware of the differences here. I've seen some folks do some fairly creative things with CF (which I hadn't been aware of before), so I thought I'd check to see if someone has figured out something clever for a checkbox. As it is, I can achieve the result by creating additional fields/objects and using them together, along with some scripting. I was just hoping for something more elegant.

Value is "Empty"?

Not sure what you mean here. The result I'm after is that the line attributes of the checkbox (the "box" itself) be visible only when certain conditions are met. Can you elaborate? Thanks!

Share this post


Link to post
Share on other sites

If I'm understanding your need, I'll make you a sample later. I'm with a client now, and have an appointment at 1:30 out of the office. so it will be awhile.

Lee

BTW. please update your profile to reflect your current version of FileMaker. Here is a quick link My Profile

Share this post


Link to post
Share on other sites

Just to clarify, are you wanting the checkbox to be completely gone, or just look un-checked?

Depending on your background, you could lay a text object over your checkbox, give it an invisible background color, then conditionally apply a background color that matches the background behind it.

Share this post


Link to post
Share on other sites

If I'm understanding your need, I'll make you a sample later. I'm with a client now, and have an appointment at 1:30 out of the office. so it will be awhile.

Lee

BTW. please update your profile to reflect your current version of FileMaker. Here is a quick like My Profile

Thanks. Looking forward to your sample. I've updated my profile as you suggested.

Share this post


Link to post
Share on other sites

Just to clarify, are you wanting the checkbox to be completely gone, or just look un-checked?

Completely gone. Here's the sit: client has rows of records in a list. Depending on data in certain records, client needs to see an (initially empty) checkbox next to a field in that record. So, eg., if "name" = A or B or C, checkbox, otherwise, no checkbox.

Depending on your background, you could lay a text object over your checkbox, give it an invisible background color, then conditionally apply a background color that matches the background behind it.

Let me try your suggestion. I do have alternating background colors in the list, but I think I can conditionally format for those using Get (PortalRow) or Mod (Get (RecordNumber) ), etc. Thanks.

Share this post


Link to post
Share on other sites

For conditionally displaying objects I usually use a hidden (invisible) tab control. Create two tabs, one for your condition and one for everything else. When the condition is met navigate to the conditional tab. Of course, this requires that you scrip this process.

Share this post


Link to post
Share on other sites

For conditionally displaying objects I usually use a hidden (invisible) tab control. Create two tabs, one for your condition and one for everything else. When the condition is met navigate to the conditional tab. Of course, this requires that you scrip this process.

Do you use an OnRecordLoad layout script trigger to refresh the active tab when switching records?

Share this post


Link to post
Share on other sites

Before we do a lot of speculating on your need, try looking at some examples at Database Pros by doing a search for Visibility and/or Conditional Value Lists to see if there is something there that is an example of what you need

Lee

Share this post


Link to post
Share on other sites

Hi Lee,

I've searched the examples at Database Pros but did not find anything relating to checkboxes. The techniques shown there are all from version 7 or earlier, btw. Did you have a chance to create the sample you mentioned earlier? Thanks.

Share this post


Link to post
Share on other sites

I'm only 6 months late :)  but what I do for this stuff is create a field called "_dummy" in every table - as it's fields that can be controlled by CF.

This field contains no data, data cannot be entered, and can be used multiple times on any given layout. Depending on the condition, I just make the dummy field the same as the background color of the page - or whatever it's sitting on. I also make sure the cursor does not change to a pointer otherwise the location is given away.

 

The only drawback I've found is that if it's got a tab stop then it can be selected under the dummy field - but it's no biggie. Hope this helps. I'm happy to draw up a sample if you like.

 

Greg

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

By using this site, you agree to our Terms of Use.