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.

Featured Replies

I want to create a toggle button in FM.

The button on the first click should just change color and if the user does not click a second time within say 2 seconds, the button returns to its original state.

Would using a repeating container field with 2 repetitions to hold 2 images showing the state of the button work?

Click 1 sets the flag to 1

set the repeating field to show the second image

if click 2 occurs within 2 seconds,

set flag to 0

execute a script

else

set flag to 0

end if

The trouble is how do I time the clicks?

Is there a builtin function that can time the clicks? Should I use a timestamp for each click and calculate the difference to time the click?

Thanks in advance for any help

A timestamp seems like the way to go. You could have the click set a modification time field or carry a script parameter of the current time-of-click and compare it to a variable that stores the last click time...

Regards, Don

Thinking a bit more though, you're going to have trouble returning the color to the if there is no second click.

There would have to be some event to trigger a screen refresh...

Are you going to lock the user into a loop so you can keep an eye on the time and update the button image on each cycle?

Regards, Don

You could use a webviewer with a javascript to fade the button back to its original color.

  • Author

How 'bout using an external applescript to track the time elapsed and then Applescript GUI scripting to run a second script to set the state of the button?

That way the user would not be locked into a loop?

Also has anyone tried the zipp script for this problem?

Thanks for all the posts

This seems overly complex

Why not a simple toggle button?

button.fp7.zip

I thought there was a request here for 'revert, unless confirmed within 2 seconds' or something like that? Seems very similar to:

http://www.fmforums.com/forum/showtopic.php?tid/176521/

  • Author

Absolutely ! the original request is for revert in 2 seconds if not confirmed.

Was hoping to allow users make minimum mouse moves during data entry thus avoiding irritating dialogs like "Are you really sure you want to confirm?"

I was just thinking does it need to be so complex.

Anyway after a little thought it was actually really simple.

Attached...

best stuart

button_2.fp7.zip

Ps as you are using version 9 i would also use conditional formatting but as i am not i can not :

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.