cinolas Posted December 5, 2001 Posted December 5, 2001 I have 2 simple conditions on a page, the first one : "[FMP-if:Field:Conditions code 2.eq.1] <p align="center"><b><font color="#FF0000">No third party allowed. You will have to contact the embassy directly.</font></b></p> [/FMP-if]" Works perfectly. But this one : "[FMP-if:Field:Conditions code 1.neq.9] <p align="center"><b><font color="#FF0000">You do not necessarily need a Visa, see the Requirements for more information.</font></b> [/FMP-if]" Completely refuses to work ! They are one after the other... I have tried to switch them around, same thing. I can't even figure out a way to go around the problem ! Thanks
MeltDown Posted December 5, 2001 Posted December 5, 2001 quote: Originally posted by cinolas: I have 2 simple conditions on a page, the first one : "[FMP-if:Field:Conditions code 2.eq.1] ... Using "Field:" in the If statement may be causing problems. Try changing your first If statement to [FMP-if:Conditions code 2 .eq. 1] and the second one to [FMP-if:Conditions code 1 .neq. 9]. Give it a whirl and see what happens. ALSO, these fields (Conditions code 2 and Conditions code 1) must be on the layout you specified when you brought up the page. And if you didn't specify the layout in the preceding page, you'll have problems. Good luck! [ December 04, 2001: Message edited by: MeltDown ]
Vaughan Posted December 5, 2001 Posted December 5, 2001 Try taking the spaces and weird characters out of the field names.
cinolas Posted December 11, 2001 Author Posted December 11, 2001 I was hoping to get it to work without having to change the field name, doing so would have quite an impact. Besides, the first if is working fine with the field name as it is... Any other suggestion ?
cinolas Posted December 11, 2001 Author Posted December 11, 2001 I tried getting rid of the "Field:" in the IF tag and it did not seem to make a difference at all. The working IF is still working and the faulty one is still faulty !
cinolas Posted December 11, 2001 Author Posted December 11, 2001 I even tried to go around it by using a Else (to force some kind of reaction) : [FMP-if:Conditions code 1.eq.9] <p align="center"><b><font color="#FF0000">Visa Required</font></b> [FMP-Else] <p align="center"><b><font color="#FF0000">You do not necessarily need a Visa, see the Requirements for more information.</font></b> [/FMP-if] No results at all The page doesn't display either of the two messages ! It seems FMP skips the second IF all together !
Vaughan Posted December 11, 2001 Posted December 11, 2001 What is it about the "conditions code 1" field that is different from the "conditions code 2" field? Are there any values in the code 1 field?
Keith M. Davie Posted December 12, 2001 Posted December 12, 2001 Perhaps I misunderstand something, but the cdml reference states that the thrid parameter is dependent on the comparison type of the left side. It further states that Boolean statements occur only with .eq. and .neq. Since you are using these comparators it would seem to follow that you must make a boolean condition in the field. Or you might change the comparator to .cn. and .ncn., depending on your data in the field. [ December 11, 2001: Message edited by: Keith M. Davie ]
Vaughan Posted December 12, 2001 Posted December 12, 2001 The other way is to do the "calculation" in the database and just check for the result in the [FMP-If] tag. An example: if a field has an invoice date, and we want to make a message dependent on whether the date is less than 7 days old or not, then it's easiest to make a calc field in the databsae that does the work. One way is to leave the field empty if it's less than seven days, otherwise enter a value: datecalc: If [ Status(CurrentDate) - Datefield < 7, "", 1 ] In the html file, structure your conditional like this... [FMP-If: datecalc.eq.] message if the date is less than seven days [FMP-Else] message if seven days or more [/FMP-If] In another case the calc field ithe db could enter -- say -- a value of 1, 2, 3 or 4 to cater for four different conditions. The [FMP-If] would just check for these values accordingly.
The Bridge Posted December 12, 2001 Posted December 12, 2001 I agree with Meltdown and Vaughan, i.e. get rid of the Field: within the FMP-If tags and (eventually) take the time to rename your fields using underscores instead of spaces. It will really save a lot of headaches down the road. Other than that, I notice that you're missing a closing </P> tag in the HTML within your second FMP-If statement. Could that be causing the problem? Just a thought.
Recommended Posts
This topic is 8451 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