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.

Mouse-clicked button field passing the click through

Featured Replies

With the cursor in a field, or the field otherwise in focus, using "Get ( ActiveFieldContents )" works as expected. When I make the field into a button, the field is no longer active after the click-event has finished, hence its contents are not returned. I want to be able to use a script using "Get ( ActiveFieldContents )" generically (i.e., not tied to any specific field).

In HyperCard, which used a hierarchy for layers and objects, a mouse-click event could be passed (or not, depending on scripting) to the next layer/object after the layer/object higher in the hierarchy received the message/event, and so on. I mention this because the FM field-as-a-button seems to intercept the click and not pass it on to the field.

Ken

With 8.5, there may be other ways using Go To Object. But one way to maintain focus is to allow the cursor to leave the field and then return - let tab order do it for you. Example: Field 1 is the field you want to copy (first in tab order). Field 2 is another field (second in tab order).

Script attached to field 1 with:

Go To Previous Field

Go To Next Field

Set Field [ whatever ; Get ( ActiveFieldContents ) ]

You can also use script parameter here.

LaRetta

On second thought, I wouldn't use this method. If you change field order, it can break. I wouldn't want to base MY solution on it so I can't recommend it to anyone else either. I used it once when it was the only field on a layout (with only the Go To Previous step) but if there are other fields which were active first, it will set out of sequence on you. Not good.

  • Author

> With 8.5, there may be other ways using Go To Object.

I just tried that, where the Object name is "Get ( ActiveFieldName )", but the problem seems revolve around the fact that the field clicked never becomes active.

I just tried the tab order possibility, and it once again appears that the clicked field never becomes active. But thanks for the possiblities!

Ken

You can start your script with Go To Field [ that field ]. But I assumed you wanted dynamic. Tab order method works but only (reliably) if it is the only field.

How about the user initiating the script via the script CTRL-#'s? That leaves the field as the focus; of course button would work as well then.

How about defining a script parameter for each button = the field the button is attached to?

I'm not following, Michael. When you click the field (with button attached to field), the script activates before entering the field. I considered script parameter with Get ( ActiveFieldContents ) and script of:

Set Field [ globalText ; Get ( ScriptParameter ) ] ... globalText just being a holding area for the test

... but it wouldn't pick it up. If we preceed with Go To Field [ theField ] then we lose the dynamic ability of it. What am I missing in your suggestion, please?

Edited by Guest

Each field needs to be defined as a button, individually. At that time, tell the button which field it is attached to, i.e. make the script parameter =

SomeField

Get (ActiveFieldContents) cannot work here, since - as Ken correctly surmised - the field we are interested in will not be activated by clicking the button.

  • Author

Comment's last reply works, though as he points out, the work must be done for every field in which you desire this to work. I posed my original question in a generalized way, because the specific thing I was trying to achieve is very simple to do by direct hard coding, but I was looking for a more transportable method that I would use in other situations.

What I'm doing is opening the URL in a field, and of course all I need to do is to attach 'Open URL' with the field name as the data source.

Using Perform Script, with a script parameter of the field name, and 'Open URL [Get (Script Parameter)]' works.

Thanks to both of you for the useful discussion. I'm confident now that there is no trick to getting the mouse click to pass through to the field when it is a button. Having that as an option would be a useful feature.

Ken

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.