If you need to create collapsible and expandable fieldset, this jQuery plugin might be helpful. This plugin can collapsed or hide fieldset and it's content by clicking it's legend. You can also decide the initial state for your fieldset wheter it's expanded or collapsed. The separated CSS file will also useful if you need to modify the fieldset appearance. By the way, I named this plugin coolfieldset.
- Using Coolfieldset
Just like the other jQuery plugin, this plugin is also easy to use. Just include jQuery and this plugins inside the <head> tag.
And include the CSS file for styling the fieldset.
<link rel="stylesheet" type="text/css" href="css/jquery.coolfieldset.css" />
Prepare your fieldset.
And finally, use this script to turn your fieldsets into collapsible.
The more complete example be seen here.
The source code is available on GitHub: https://github.com/w3shaman/jquery-coolfieldset. Please feel free to contact me if you want to make any contribution for this small project.