hartmut Posted December 27, 2007 Posted December 27, 2007 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
hartmut Posted December 28, 2007 Author Posted December 28, 2007 (edited) 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 December 28, 2007 by Guest
hartmut Posted December 29, 2007 Author Posted December 29, 2007 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
Lee Smith Posted December 30, 2007 Posted December 30, 2007 Confirmed. I'm wondering, because it Saturday, that this isn't a Site problem. I will report it to Stephen. Lee
hartmut Posted December 30, 2007 Author Posted December 30, 2007 (edited) 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 December 30, 2007 by Guest
hartmut Posted December 30, 2007 Author Posted December 30, 2007 (edited) 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 December 30, 2007 by Guest
Lee Smith Posted December 30, 2007 Posted December 30, 2007 The file you just attached is available, but the one that Soren attached earlier, needs to be re-uploaded. Lee
Lee Smith Posted December 30, 2007 Posted December 30, 2007 :giggle: Sorry Soren, I meant Daniele. must have been a Freudian slip. Lee
Raybaudi Posted December 30, 2007 Posted December 30, 2007 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 Stephen has made a good job! The attachment is now OK ! : toggle_font_colorMOD.zip
Raybaudi Posted December 30, 2007 Posted December 30, 2007 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" )
comment Posted December 30, 2007 Posted December 30, 2007 I don't think it's good practice to store data in field's formatting.
Recommended Posts
This topic is 6233 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now