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.

[Help-a-noob] marking fields with different colours

Featured Replies

So I have a (necessarily) fairly complex form with lots of fields. I would very much like for the user to be able to mark some of those fields in [color:red]red and some in [color:green]green.

I'd like them to be able to do this on the fly. So, regardless of the field's content, the user can mark it red or green.

What's the most elegant way to achieve this?

Hello frosty666,

There are a number of ways you might approach this, but which one is most elegant is something that depends on how you define elegant. :wink2:

However here is one of the simpler ways to do it:

1. Place a button on your layout and link it to the Set Field[ ] command.

2. Leave the "Specify target field" attribute empty (unassigned)

3. For the calculated result formula enter:

TextColor(Get(ActiveFieldContents); 25660)

4. Name the button "Green" (and/or color it appropriately)

5. Add another similar button with the formula:

TextColor(Get(ActiveFieldContents); 11801640)

6. Name and/or color the second button red.

Now when your users place the cursor into a field and then click one of the buttons, the text in the field will change color.

Of course, you might also want to provide an additional button that changes the color back (eg using the TextColorRemove( ) function.

Or ..if you are feeling a little more adventurous, you might consider setting up the buttons with a slightly more complex formula such as:

Let([

Afc = Get(ActiveFieldContents);

Css = GetAsCSS(Afc)];

If(PatternCount(Css; "#00643C");

TextColorRemove(Afc);

TextColor(Afc; 25660))

)

...which will toggle the color (in this case green) on and off with successive clicks of the button. :mickey:

  • Author

Wow! Thanks, Ray, that was incredibly helpful.

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.