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 and showing button in Form

Featured Replies

Hi people...

Does FM provide this function whereby i can hide a button, then after the button has been clicked, the page will refresh then show another button which is initially being hidden?

Looking forward to your replies!

Regards,

Pris shocked.gif

Hi Pris,

This effect can be created using a portal with a relationship.

I have attached an example, the file itself is very basic, but it shows you the functionality of it.

If you've got any questions about it just ask, but it's pretty self explanatory.

Hope this helps

Ed

buttons.zip

You could also do it with a second layout that was nearly identical to the first. The only differences between the layouts would be up to you.

Yeah, but having multiple layouts that mirror each other creates a lot of extra work in the long run - if you make a change to one layout you have to make sure you reflect that change in its mirror. Eddy's suggestion requires only one layout and is a pretty common and accepted practice for maing things either show or hide on a layout based on some change in a value.

Yes John is right. Before I was shown this trick I used multiple layouts just to show/hide buttons. When the time came to do some serious upgrade work on the DB is was an absolute nightmare trying to keep all the layouts the same - if I changed 1 I had to change about 4! This method is a lot cleaner and a better effect than switching to another layout.

Ed

Ed,

I understand how the IFstatement in the SET GLOBAL script changes the value from 1 to 0 and vice versa but I cannot figure out what you did to make button 2 magically appear.

It sure does look handy.

Would you mind a lending a little explication here for us un-erudites?

Jarvis

Hi Jarvis,

Sorry I should have been a bit clearer in the original post.

OK Button2 is inside a poral, if you click just around the egde of Button 2, you will find the portal. This portal is based on a relationship. The relationship is between the global field and the constant field.

When the global field and the constant field match, the portal will show it's contents (the button). When the fields do not match the portal is hidden (you no longer see the button)

Just a quick note, I messed up a little in the demo file. Button 2 is set so that the pointer changes to a finger when you go over the button. You might want to stop this from happening (format -> button). This is because, even when the button is hidden, your mouse pointer will still change to a finger pointer when you go over the place where the button appears even when it is not showing.

I hope this is a bit clearer for you.

Anymore questions, just give us a shout.

Once you get used to using this method, it can be very useful.

Best regards

Ed.

PS, if you have a look for a date calculations example I posted in the samples forum, you will see an adaptation of this method, when a field contents is empty, nothing will show, but then when you enter some data into the field, other fields magically appear - this also can be useful in some databases.

Ed,

Thanks for the update.

I can learn about one thing a day and this looks like one worth staring at.

Jarvis

  • Author

Wow.. Impressive.. Thank you guys.

  • 2 months later...

******* that's cool!!!!!

You can use that to show/hide any layout objects!!!

Really easy to implement also - well done!!!

Thanks

Question; What is the value in using a portal over using a container field? Just Curious.

Phil

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.