Jump to content

This topic is 8120 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I have two fields that I would like to compare, and if the same change the text colour to highlight the field.

My code is, however it does not work. Both fields are numbers, and if I substitute a number for "{FMP-Field:Currentday}" it works fine! My code is;

<FONT [FMP-IF: Day5.eq. {FMP-Field:Currentday}] COLOR="#ff3300"

[/FMP-IF]> [FMP-FIELD: Day5]</FONT>

Using Mac 9.2, FM 4.1.

thanks

ger

Posted

Hi, you can use an FMP-Field like that in an "IF" and it will work fine. You can also deliver all kinds of HTML as a result, too so unless I've really missed something in your code I can only suggest that it's a function of using FMP4.

This one works for me in FMP5 and has html code, FMP fields an else and all kinds of junk in it:

[FMP-IF: CurrentDate.lte.{FMP-Field:end}]

<A HREF="http://mydomain.com/holidays/FMPro?-db=thedatabase&-format=record_detail.htm&-error=search_error.htm&-lay=layout1&-op=eq&record_number=[FMP-FIELD:record_number]&-find"><FONT SIZE="-2" FACE="verdana,arial,geneva,sansserif" COLOR="#333333"><B>[FMP-FIELD: start][FMP-FIELD: am_pm]</B></FONT></A>[FMP-ELSE]

<FONT SIZE="-2" FACE="verdana,arial,geneva,sansserif" COLOR="#333333"><B>[FMP-FIELD: start][FMP-FIELD: am_pm]</B></FONT>

[/FMP-IF]</P>

Can I suggest a workround to get it going: Create a calculation field in Filemaker to do the work - like If(field1=Field2,"#FF0000","#FFFFF") - and just deliver that. The one below colours a table row, but it's the same principle:

<TD WIDTH=50 BGCOLOR="#[fmp-field:colourfield]">

The advantage here is that you can store your calculations in the Database, rather than having to do them on the fly. This is a lot quicker, especially in FMP4.

regards, Jeff

This topic is 8120 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.