Condition in html

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
jktb75
Posts: 6
Joined: Tue Apr 26, 2016 11:02 pm

Condition in html

Post by jktb75 »

Hi all,

Is it possible to have a condition in HTML?

I have 2 images that would like to put in an HTML in VP, but only display one if condition IS DEFINED.

Hope this makes sense. Thank you
Rennur
Posts: 1191
Joined: Thu Mar 01, 2012 5:13 am
Location: Sydney, Australia

Re: Condition in html

Post by Rennur »

Yes it is.

In BO forms use the SHOW Action.

Example:

Code: Select all

<<IF MyBo.IsField='Option 1'  THEN SHOW SECTION_START>>
<img alt="Pic1" src="<<MyBO.Pic1>>" width="400" height="150">
<<SECTION_END>>

Code: Select all

<<IF MyBo.IsField='Option 2'  THEN SHOW SECTION_START>>
<img alt="Pic1" src="<<MyBO.Pic2>>" width="400" height="150">
<<SECTION_END>>
From the User Guide:
You can also conditionally include the entire sections of a document template into the final document. To define a condition of section inclusion, add the condition followed by the action “SHOW SECTION_START”. This also marks the start of the section. To mark the end of the section include, the following tag: <<SECTION_END>>. For example,
 
<<IF Account.Balance > 1000 THEN SHOW SECTION_START>>
The text of the section follows …
<<SECTION_END>
The rest of the text follows
jktb75
Posts: 6
Joined: Tue Apr 26, 2016 11:02 pm

Re: Condition in html

Post by jktb75 »

That worked. Thank you
Post Reply