Forms
Documentation > Forms
Creating interactive forms is easy in BoltWire. One of the best way to learn how to create these forms is to study BoltWire's default action pages. Forms however are not limited to action pages --they can be put anywhere in your site by site editors and admins.
Create Forms
To create an interactive form, begin and end your form with the following syntax:
<code>
[form]
...
[form]
</code>
In between these two form tags, you place your various form elements, such as checkboxes, radio buttons, text input fields, and drop down menu's. Each will have the following basic format:
<code>
[type name="field" value="some value"]
</code>
Allowed types include: text, check, radio, password, hidden, image, select, option, box, file, button, submit, and reset. The value field is optional.
Also allowed is a special session type (which sends the info to the form processor via a session variable rather than a form field), and a link type which can submit a form by clicking some text on the page. BoltWire has many shortcuts for building forms quickly and easily.
Here is a sample form that might be created to setup an addressbook for example. (Without form commands however it will not do anything but display).
<code>
[form]
Name:
Phone:
Email:
Address:
[form]
</code>
For more information study some of the forms on the various action pages.
Note: only admins and editors are able to create forms in BoltWire.
Here are a few basic points of information:
- Each form should begin and end with a [form] markup. Various parameters can go into the initial form tag, but nothing is needed for most forms.
- Additional commands can be added of the following syntax: [type name value parameters]. Available types include: text, check (checkbox), radio, hidden, password, select, option, box (textarea), upload, image, submit, reset, button. Most standard parameters are accepted. Box and select need a closing [box] or [select] tag.
- You can also set the type to session to pass the data invisibly to the forms processor using session variables. There is also an optional [link linkpage label] markup to create a link that submits a form.
Some things to remember
- Many BOLT commands, especially those that write to pages, must be set using the session input type. This helps to protect against various security risks. Otherwise, all input types works roughly the same.
- The box input allows you to prefill the value of the input field by simply inserting content between the opening and closing box tag, often using the source function.
- Javascript can be added into a form by defining an element in the $BOLTformJs array in your local config/config.php file, and then adding js=index (of the element) to the input's parameters.
- The content of field1 can be inserted into field2 by using the markup {=field1} as the value of field2. These are called field replacements.
- All BoltWire form commands are processed in the exact order they occur in the form --whether post or session. Remembering the order of processing is often important to form execution.
The sample form doesn't display anything for me.

