FMPBrad Posted June 12, 2003 Posted June 12, 2003 Hello, Is it possible to test against a valuelistitem in an if directive? Example: <select name="from_the_list"> [FMP-ValueList:theList, list=myList] <option value="[FMP-ValueListItem]"> [FMP-if:ValueListItem.eq.specificItem] Display custom item [FMP-else] [FMP-ValueListItem] [/FMP-if] </option> [/FMP-ValueList] </select> The code above doesn't seem to work for me. Thank you in advance for any insight. Bradley
Garry Claridge Posted June 12, 2003 Posted June 12, 2003 In theory your code should work. Good Luck. Garry
FMPBrad Posted June 12, 2003 Author Posted June 12, 2003 Thank you for your post reply. I think so, too. I was thinking it was a meta-FMP tag, so I tried {} as used in the Inline tag... in all various forms. No success. Maybe it just doesn't work. Bradley
Anatoli Posted June 14, 2003 Posted June 14, 2003 I do not think it is correct code. How the IF can validate on server, when user is selecting something in browser? You have to select something in browser, submit that choice to WebCompanion and on next page you can have the IF evaluation.
Garry Claridge Posted June 15, 2003 Posted June 15, 2003 Anatoli, According to the CDML Reference Database "ValueListItem" can be used as a "left-hand" argument in an "IF" tag. All of Bradley's processing is intended for the server, as it is setting-up the "Select" tags. All the best. Garry
Anatoli Posted June 15, 2003 Posted June 15, 2003 In that case you are right Garry and I misunderstand the problem. If the IF is processed before the page is sent as a reaction to already entered value, it can work. If the IF is intended to be processed, as I've originally understood as reaction to user choice, then it is not correct way. When I've got stuck in such problem, after 5-10 minutes I'll give up and I am going for different logic: IF value in field = specificItem do this code -- Display custom item Else do another code <select> value list </select> Endif HTH
FMPBrad Posted June 19, 2003 Author Posted June 19, 2003 Thank you for you post replies. Yes, the value list should be processed by the WC as it is generated for the Web page. That's why I thought it would be natural to test the list values against a specific value while processing. Bradley
Recommended Posts
This topic is 8166 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