Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Multiform module, how can I show/hide fields when an checkbox is checked/unchecked?

Go to End

3 Posts   1839 Views


Community Member, 37 Posts

10 January 2013 at 4:51am


I use the multiform to make an form with several steps, but in 1 step I want to make that when the checkbox is checked there will be
several new fields shown for input.

Bit of the code:
new CheckboxsetField($name ='Voogd2', $title = 'Voer eventueel een 2e persoon in', $source = array('Toevoegen' => Toevoegen')),

new LabelField($name = 'Persoonsgegevens2', $title = '<strong><br/>Persoonsgegevens<br/><br/></strong>', null, true),
new TextField('Voornaam2', 'Voornaam'),
new TextField('Achternaam2', 'Achternaam'),

So when the checkbox is checked, show the labelfield en textfields.

See entire code below.


Attached Files

Forum Moderator, 5523 Posts

10 January 2013 at 5:41pm

To do any show/hide logic you have to use javascript. Lots of javascript tutorials on the web (e.g


Community Member, 2 Posts

22 November 2013 at 11:47am

There's thread here showing how to use JavaScript with SilverStripe to hide / display form fields: