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.

Set field (or variable) to selected field script

Featured Replies

Hi,

I'm not sure where to start on my script, but the plan is:

I have 3 fields, Field A, Field B and Field C

Each displays calculated data (in this instance dates) and each field is a button. I'm trying to get it so that when the user clicks one of the fields, it sets another field (or variable, but I don't have much experience with those) to that field's value.

I could create 3 scripts, one for each field. I could also create a script that selects the contents of the selected field and copy and pastes it into another field. But both these methods seem a little cumbersome.

Does anyone have any ideas how i can do this in a single script suitable for all fields? I'm thinking something like:

"Set Field X to Current Field", but I'm not aware of any such script step.

 

Thank you in advance for any help.

34 minutes ago, Ninja said:

each field is a button.

When a field is formatted as a button, the user clicks on the button, not on the field - and the underlying field does not become active in the process.

 

37 minutes ago, Ninja said:

how i can do this in a single script suitable for all fields? 

Use a script parameter and attach a different parameter to each button.

Use script parameters as Comment said to tell the script that which button has been clicked. 

 

Instead of adding buttons on top of fields, use script triggers to run the script. Either "on object entre" or "on objecmodified" (if I am not mistaken by names of triggers. ;)

  • Author

Ah script parameters. I've not used those before but they worked perfectly! Thank you.

I elected to set the fields to buttons rather than using script triggers (thank you for the suggestion siroos), as entering the fields cause them to look slightly odd, and the parameters were able to predict the field's content in the way I was using them.

Thank you both for your help.

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.