Code By Cody
7Sep/11Off

A Simple Way to Hide and Show HTML Elements Using VisualForce

Posted by Cody Sechelski

The Problem

So you are programing a VisualForce page and you find yourself needing to hide or show  an HTML element on the page. No problem. Here are three simple ways to hide or show one or multiple HTML element just by setting a property on the Controller.

Solution

Option 1 - Postback

A real easy way to hide or show an HTML element is to evaluate a Boolean  property on the Controller. A lot of folks may not realize it, but you can insert the same formulas you use in Validation Rules, Workflow Rules and so on inside any merge field on the page.