Just include the css and js files. jQuery is a dependency. Add 'class="collapsible"' to a fieldset to have it collapsed by default; by clicking on its <legend> you toggle between visible and not.
malteo/bootstrap-collapsible-fieldset
Twitter Bootstrap's form fieldsets collapsible option
JavaScript