Seeking a Better way to Create a Collapsible Fieldset I'm creating a collapsible fieldset on my home page and have put the following code in a block (structure > blocks):

&lt;script type="text/javascript" src="/misc/form.js"&gt;&lt;/script&gt; 
&lt;script type="text/javascript" src="/misc/collapse.js"&gt;&lt;/script&gt; 

&lt;form&gt;
  &lt;div&gt;
    &lt;fieldset class="collapsible form-wrapper"&gt;
      &lt;legend&gt;
        &lt;span class="fieldset-legend"&gt;Legend&lt;/span&gt;
      &lt;/legend&gt;
      &lt;div class="fieldset-wrapper"&gt;Content&lt;/div&gt;
    &lt;/fieldset&gt;
  &lt;/div&gt;
&lt;/form&gt;


It actually works what I did using the 'Full HTML' text format. I did it this way though only because I don't know the preferred way. 

I imagine this would normally be done (for security reasons or something...) by creating a module or via a preprocess function.

Am I wrong to second guess myself here? Maybe it's standard practice to do what I've done above. 

Any guidance is appreciated. Thanks.
Form submit would not work unless you have an action for it. 

You should rather do it in Drupal way, you will need following.


Create Custom Module in drupal.
Block API to create your custom block
Forms API. to create a custom form and call it in your custom block.


Here goes a demo module which will help you understanding the API
https://github.com/arpitr/demo_block_form

Installing the module will give you a block which will look like as