How do I code conditional text?

kkoenen

31-10-2014

I have a form that needs to display Text Block 1 only if the "Total" is up to $499.99." If $500 or greater, I need to hide Text Block 1 and show Text Block 2.

Is there any way I can do this?

Thanks.

Accepted Solutions (0)

Answers (2)

Answers (2)

radzmar

MVP

31-10-2014

Assuming your text blocks are different text objects and total is a numerice field, you can use a script in the total field calculate event.

FormCalc:


if ($ lt 500) then


    textBlock1.presence = "visible"


    textBlock2.presence = "hidden"


else


    textBlock1.presence = "hidden"


    textBlock2.presence = "visible"


endif


JavaScript:



textBlock1.presence = this.rawValue < 500 ? "visible" : "hidden";


textBlock2.presence = this.rawValue < 500 ? "hidden" : "visible



";