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.

toggle Font Color

Featured Replies

Hello

I have a field that i would like to toggle the font color in. I made the field into a button and I used the following script to make the click turn the font from yellow to green and if it was already green to yellow.

If[TextColor ( colors::first ; RGB ( 255 ; 255 ; 0 ) ) //yellow

Insert Calculated result[select;TextColor ( Colors::first ; RGB ( 0 ; 255 ; 0 ) )//green

Else If[TextColor ( colors::first ; RGB ( 0 ; 255 ; 0 ) ) //green

Insert Calculated result[select;TextColor ( Colors::first ; RGB ( 255 ; 255 ; 0 ) )//yellow

end

But it doesn't do any toggleling when I click on the field as a button.

Can someone tell me how I can make the font color toggle this way?

Thanks

Dave

  • Author

Thank you so much

I was looking for this answer all night long.

It means so much that you showed me how to do this

Dave

Also

I do have another concern because in my case I am actually trying to do this exactly with this toggling of the font color:

Example:

If the field "numbers" contains the word "One"

change the text color to purple rgb (150,0,255)

if it is already green.

But if it is text color is yellow already and the field "numbers " contains the word "one" - i would need the

change the color to red.

and put the amount of 1 in a field "counted"

This is because I want to be able to track all the red text and tabulate it with a running tabulation and maybe more later.

So I still need help when the color has become yellow on how to further change the color to red and add the instance as part of a running total. I am making an example file.

toggle_font_color.fp7.zip

Edited by Guest

Ok

Try this one.

  • Author

HI Danielle,

I am somehow unable to download the file. There is an error message which says the file does not exist.

I don't know what that means

I am anxious to receive the file but it says it is not there

Dave

Confirmed.

I'm wondering, because it Saturday, that this isn't a Site problem. I will report it to Stephen.

Lee

  • Author

Thanks

Dave

ACTUALLY

In my example I am looking to change the font color from green to purple if it is originally green and yellow to red it if is originally yellow.

Edited by Guest

  • Author

I am not sure what you mean.

The problem is trying to download the file from danielle called

toggle_font_colorMOD.zip (6.44 KB)

Keep getting an error message

toggle_font_color.fp7.zip

Edited by Guest

The file you just attached is available, but the one that Soren attached earlier, needs to be re-uploaded.

Lee

What have I done in this thread???

--sd

:giggle: :giggle::giggle:

Sorry Soren, I meant Daniele. must have been a Freudian slip.

Lee

I am somehow unable to download the file.

EDIT: it seems that I can't attach anything... all my tries made an unreadable attachment.

EDIT 2 B) Stephen has made a good job! The attachment is now OK ! :

toggle_font_colorMOD.zip

BTW:

1) make the field "font color" a calculation field and calc:

Case(

random number = "One" and PatternCount ( GetAsCSS ( Self ) ; "00FF00" ) ;TextColor ( random number ; RGB ( 150 ; 0 ; 255 ) );

random number = "One" and PatternCount ( GetAsCSS ( Self ) ; "FFFF00" ) ;TextColor ( random number ; RGB ( 255 ; 0 ; 0 ) );

random number = "Two" ; TextColor ( random number ; RGB ( 255 ; 255 ; 0 ) );//yellow

random number = "Three" ; TextColor ( random number ; RGB ( 0 ; 255 ; 0 ) )//green

)

2) make the field "number" a calculation field and calc:

PatternCount ( GetAsCSS ( fontColor ) ; "FF0000" )

I don't think it's good practice to store data in field's formatting.

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.