@@ -45,6 +45,36 @@ On submission, the function ``my_special_submit_handler`` is being called with t
...
@@ -45,6 +45,36 @@ On submission, the function ``my_special_submit_handler`` is being called with t
As the generated form is a plain HTML form, the javascript form API can be used. However, there are special methods in the ``form_elements`` module e.g. :doc:`get_fields <../api/module-form_elements>` which are especially designed to interact with the forms generated by the ``make_form`` factory.
As the generated form is a plain HTML form, the javascript form API can be used. However, there are special methods in the ``form_elements`` module e.g. :doc:`get_fields <../api/module-form_elements>` which are especially designed to interact with the forms generated by the ``make_form`` factory.
Placing the form in a panel below the navbar
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
There are functions in the `form_panel` module to make it easy to place forms at the typical location:
below the navbar. The following shows how the config (see above) is passed to
`init_show_form_panel_button` a direct call to `make_form` is no longer necessary.
.. code-block:: javascript
const title = "Upload CSV File"; // title of the form and text in the toolbox
const panel_id = "csv_upload_form_panel";
/**
* Add a button to the navbar, saying "Upload CSV File" which opens a