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

Script to show/hide fields

Featured Replies

I'd like to create a button to show/hide fields in a database. I've searched the forum, but could only find conditionals using radio buttons and such.

I want to be able to click on a "+" button to show the fields and "-" button to hide the fields. I'm not sure if these buttons should be based on a script or portal.

I appreciate any help you can give!

Karen

The easiest method would be to have another layout without those fields and just have buttons that switch back and forth between the two layouts.

If that is not feasible then here are some other threads you can take a look at.

Visibility Methods

Visibility Link 2

What would be the purpose of this? Normally, a "+" button signifies 'add another one of the same kind'. In Filemaker, that would - in most cases - mean 'add another related record', not 'show another field'. For this, you would use a portal, and you could use "+" and "-" buttons to add/delete related records.

OT:

i think like this even though not a FM trick, view the photo on my site, and click the green lock on the left to show hide details

Link

I think John's reply covers exactly this type of situation. In version 8 and above, you would probably use a tab control object for this.

karen

look at the attached file. The hide and seek of the menu is done with a portal. look at the relationship and the fields. Press the menu button for the menu to appear and press it a second time and the menu disappears. The file is a FM version 6 file.

I hope this works for you.

Lionel

hideandseek.zip

Edited by Guest

  • Author

I guess I'm too new to this forum...I can open the zipped files but cannot touch them, as it says I do not have access.

Robert: I clicked on the link to your website and that is exactly what I want to do! Now, how did you do it :)

Thank you all so much for your replies!!

Karen

Karen

You will need to add three field to your database

1)Menustatus (text field)

2) Condcalc is a calculation field.

case [isempty(Menustatus;" ","1"]

3) Constant is a calculation field = "1"

Make a self join relationship between the fields as

Condcalc = Constant

Make a portal using this relationship and install the fields you want to hide or show.

Add this script to a button for the hide and seek

If[Menustatus = 1]

set field [Menustatus," "]

else

set field (Menustatus, "1"]

end if

This will bring forth the fields with the button is press and hide the fields again when the button is press again or you can automatic it to hide the fields upon exiting with an exit script.

Hope this helps

Lionel

Edited by Guest

  • Author

I will try that...thanks, Lionel!!

Karen

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.