Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Hiding or Showing a Field

Featured Replies

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.

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.

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.

  • Author

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

Here is a quick file.

Its not as elegant as I forst thought because the fields are still enterable / editable even if they are whited out.

John

smoking.zip

  • Author

Thank you very muck, Backsmith.

That' s it. You' ve saved my day. Thank you again.

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

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...

  • Author

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.

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).

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.

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.