Jump to content

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

Recommended Posts

Posted

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

Posted

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

Posted

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.

Posted

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

Posted

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

Posted

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

This topic is 7928 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.