+ Start a Discussion

Collapse/Expand on Alternate Clicks



In a custom visual force page, there is a pageblock . I want to create a command button or link by clicking which the page block should expand and on clicking again it should collapse. Basically it should expand/collpase on alternate clicks and it should be in collpased state at the time of loading the page. I think it can be achieved using java script for onlick attribute of command link or button. Can some provide sample code to achieve this? (I know we can use collpasible attribute of pageblock  but I dont want to use it)