Version 4 > User Guides > V4 Transition Guide > Forms

Forms

Forms and questions are regular content in V4.

V4 has new question types, including HTML5 input types like number, range, date, time, email, and url. (Behaviours may vary from browser to browser.) File uploads are permitted in all V4 forms.

V4 no longer has question libraries. Instead, any existing form doubles as a library – to re-use a question, just copy it from another form that has it set up the way you like.

Layouts

The "content" of a form is used as its layout. If you include merge codes for your questions, the questions will be placed in those positions. Otherwise, the questions will be appended to the content (so the content will serve as more of a "preamble" to the form).

You can use merge codes like:

[ [question_name] ] - insert full question + input

[ [question_name:prompt] ] - insert question only

[ [question_name:input] ] - insert input field only

[ [question_name:input:N] ] - insert sub-input field #N only (eg. a single radio button or checklist box)

In addition to custom form layouts, you can have custom question layouts. For those, you can use the following merge codes:

[ [prompt] ] - insert question only

[ [input] ] - insert input field only

(Note that extra spaces were added in the above merge codes so that they would not be processed by the CMS.)

If the regular question field is not long enough, or requires special HTML formatting, create a question layout and enter the question there. It can be any length and have special formatting, or even embedded media. You can even use irregular layouts where the inputs are placed in special positions like this:

I, [ [input] ], agree to the terms and conditions.

Note that checkbox questions are automatically formatted in reverse, with input first.

Replies

When you submit a form, you receive a reply message. Use the reply tool to compose/edit this reply, including by adding merge codes.

Multipart Forms

Forms can be broken into parts that are completed sequentially. Each part is treated as its own form. The 2nd, 3rd, etc, parts should be placed under the starting form. All of the form parts should have the "multipart form" option checked off.

  • just as each part is handled as a distinct form, the responses to each part are also stored separately. The Forms module does try to aggregate the responses together for you.
  • note that nothing compels someone to complete all of the parts, so you may end up with partial responses.
  • if you specify a multipart form condition on one of the parts, you will only be shown that part if the condition is true. Otherwise it will skip to the next part.

Special Forms

  • Use the Quiz module to add answer keys and marking to your forms.
  • Check off the order form option, and add pricing to your form to make special e-commerce enabled forms.
  • Use the single submission only option to make a ballot or election form.
  • You can break your form into multiple parts and make some parts conditional on previous answers.