Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Hiding or Showing a Field


This topic is 5451 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hi everyone,

I'm trying to develop a medical database.

My problem is:

I' m trying to make a field about the status of smoking.

Ex: Do you smoke?

Yes (if yes nothing will happen)

No (if no another field containig 2 other radio buttons and a text box will apear next to "no" button)

How can I apply this trick to my database.

Thank you.

Posted

Hi

You could use conditional formatting to change the colour of the supplimetary questions dependant on the value of the smoking field.

Or you could duplicate the layout and on the question.smoking layout add your extra questions.

Make the yes smokimg answer a button that inserts the necessary value and changes to the questions.smoking layout.

Or..

you could use a Show Custom Dialog to ask your extra questions. Calling it with a button as above.

hope that gets you started.

Posted

Your using FM10, so I'd setup a tab, one occurrence blank,the other with the additional fields. Label the tabs yes no in the object info window. Generate a script that goes to object yes or no depending on the content of the test field. Set script trigger for the test field to on object exit. Set fill and line colors to none and set the label width to 0 to hide the tab. You may also want to trigger the script on record load to insure the proper info is displayed when records are viewed. This is done at the layout setup window.

Posted

Thank you for your quick replies. But I'm a little bit confused. The finest solution is "conditional formatting" I think. After trying a few attemts couldn' succed at all. Can you post me small example. Thank you

Posted (edited)

The condt'l formatting idea isn't the best idea (although it looks like it is). As even backsmith says, "the fields are still enterable."

Yikes! You might end up with odd data.

Try Rod's idea of a hidden tab panel. This will prevent the user from accessing the irrelevant fields.

PS: Demo has hidden tab panel. You don't really need object names, just go to a field in the desired tab.

HiddenTab.fp7.zip

Edited by Guest
Only fair to post a demo
Posted

As soon as I posted this, I realized that you need to clear fields in case the user switches from Yes to No. And you'll probably want to provide a warning dialog.

Working on a new demo...

Posted

Hi Barbara, you're right. At first cond. formating seemed to be the best choice for me, but it wasn't (because of two reasons).

Yes, as you said data entranca is still possible.

And I have to use radio buttons in "show mode", but they still exist in the "hide mode".

Your 1st example is nearly what I want. But in both situations (yes/no) there has to be a field (field 1 in yes, fields 2 and 3 in no). Is there a way to make one situation completely empty?

Thank you again. And sorry for my late post.

Posted

If there's a third option (Yes No None), then when None is chosen you'll need to clear both tab panel fields, and perhaps set an empty tab panel to the front.

FM isn't the best at disclosure. My instinct is to step back from this and see if you can simplify the data model. For example, I don't typically do a radio Y/N, but rather one numeric flag field, flag_IsSmoker which is set to 1 (use a value list that equals 1 and set the field to a checkbox).

Posted

Rereading your post, I think I've jumped to a conclusion. You do not need to have fields in both tabs. If there is no field in a tab, you WILL need to name the tabs and use Go to Object (bcs there is no field in the tab to navigate to).

So, yes, you can have an empty tab panel.

This topic is 5451 days old. Please don't post here. Open a new topic instead.

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
×
×
  • Create New...

Important Information

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