Create Form-like Content in a Notebook
Form Notebooks—structured, form-like content in Wolfram Notebooks—have a WYSIWYG-like authoring environment, optimized for inserting form elements and open coding areas to be later scraped into an Association .
Open a new Form Authoring Notebook
Open a new Form Authoring Notebook by selecting it from File ▶ New ▶ Programmatic Notebook ▶ Form Notebook Authoring:
- Alternatively, you can open a new Form Authoring Notebook programmatically using CreateNotebook [“FormNotebookAuthoring”].
Add an input field form element
Add an input field from Insert ▶ Form Element ▶ Input Field:
Customize the form element
In template view, edit the information then select “Confirm” to finalize the changes:
Examine the information in code view to see the raw FormObject :
Use preview to examine how the information will look in a WYSIWYG fashion before generating the Form Notebook:
Add a key to the form element
Create a Key for the input fields so that you can grab necessary information programmatically:
- Generally, keys are used to lump certain form elements together across notebooks for easy tabulation. E.g., a teacher grading a quiz and comparing solutions to their real value.
- Keys are restricted to plain text characters.
- Only contents associated with a Key in the authoring notebook will be scraped.
Add an editable notebook area form element
Editable notebook areas let end-users execute code in the generated Form Notebook. Add one to the authoring notebook with Insert ▶ Editable Notebook Area:
Add content to the editable notebook area and edit the key:
- Editable notebook areas will scrape all cells entered within them and return raw cell expressions. It is up to the author to futher parse this for the necessary data.
Open the settings and modify them for your needs:
- You can add or remove submission timestamp from All key using the checkbox in Settings.
- For more information on creating custom submission actions, see Customize the Behavior of Form Notebook Submission.
Generate the Form Notebook
Select “Generate” to create the Form Notebook:
- All authoring-only elements will be removed after generation.
Fill out and Submit the notebook
Using the generated Form Notebook, fill out the information and submit the form:
- CreateDocument is the default submission type.
- You can change submission types in the settings dialog from a previous step.