Forms

By the Syncfusion DevTutorials team · Last updated

Build forms with text fields, check boxes, drop-down lists, and content controls, and set their properties.

Sign-up sheets, surveys, order forms, and applications all ask people to fill in the same information. A Word form gives them neat boxes to type in, check boxes to tick, and lists to choose from, while the rest of the document stays as it is. In this lesson, you'll add text fields, check boxes, drop-down lists, and content controls, and set their properties.

Open the Word sandbox and follow along.

Two kinds of form tools

Before you start building a form, it helps to know which type of form tool you need. Word has two families of form tools:

ToolWhat it isBest for
Legacy form fieldsThe classic text, check box, and drop-down fieldsSimple forms that are filled in inside Word, with protection turned on
Content controlsNewer boxes for text, dates, lists, pictures, and check boxesModern forms, templates, and forms linked to data

Where to find them:

  • In the sandbox: look for Form Fields (text, check box, drop-down) on the Insert tab.
  • In Microsoft Word: both live on the Developer tab. If you don't see it, go to File > Options > Customize Ribbon and tick Developer.

Put your form in a table: labels like Name: in the left column and fields in the right. The table keeps everything lined up, however long the labels are. Hide the borders afterwards if you prefer a cleaner look.

Text form fields

The simplest form field is the one people type in. A text form field is a box where people type an answer, such as a name, an address, or a phone number.

  1. Click where the field should go, usually right after a label like Name:.
  2. Insert a Text Form Field (sandbox: Insert > Form Fields > Text).
  3. A gray box appears. That's the field.

Check box fields

For a yes-or-no answer, use a check box: a small square that people can tick or untick, such as "I agree to the terms".

  1. Click where the check box should go, usually just before its label.
  2. Insert a Check Box Form Field.

Drop-down fields

When the answers must come from a fixed list, use a drop-down. A drop-down field lets people pick one answer from a list, so everyone's answers match. Use it for things like T-shirt sizes, departments, or days of the week.

  1. Click where the list should go.
  2. Insert a Drop-Down Form Field.
  3. Double-click the field to open its properties, and add the choices one by one (for example Small, Medium, Large).

A drop-down only shows its first choice until someone picks another, and you can't choose from it while editing. People choose from it when they fill in the form, after you protect it for form filling (Lesson 24).

Content controls

Legacy fields cover the basics, but for modern forms Word offers a second set of tools. Content controls are the modern version of form fields. In Microsoft Word, they're on the Developer tab, in the Controls group:

ControlWhat people do with it
Plain Text / Rich TextType text (Rich Text also allows formatting)
Check BoxTick a box
Drop-Down List / Combo BoxPick from a list (a combo box also lets them type their own answer)
Date PickerPick a date from a calendar
PictureInsert a picture, like a photo on an ID form

Each content control shows placeholder text, such as "Click or tap here to enter text.", which disappears when someone starts typing.

Content controls work in forms without protection, and can be linked to XML data (Lesson 24). If the sandbox doesn't have a button for a content control you need, build that part of the form in Microsoft Word.

Form properties

Whichever kind of field you use, each one has settings you can adjust. Every field and control has properties that control how it behaves. Double-click a legacy form field (or select a content control and click Properties in Microsoft Word) to open them:

PropertyWhat it does
Name or TitleIdentifies the field, such as FullName
Default textText that appears before anyone types
Maximum lengthLimits how many characters can be typed
TypeFor text fields: regular text, number, date, and so on
ChoicesFor drop-downs: the list of options, in order
Checked by defaultFor check boxes: start ticked or unticked

Give every field a clear name. It makes the form easier to manage, and it's how the answers are identified when data is collected from the form.

Common mistakes

Here are the most common traps, and how to fix them:

MistakeWhat happensHow to fix it
Typing into the label area instead of a fieldThe answer becomes part of the form textAdd a field, and protect the form for filling in
Drop-down with no choices addedThe list is emptyDouble-click the field and add the choices
Underscores ______ used as answer linesTyping pushes the line and breaks the layoutUse a text form field instead
No table for layoutFields drift out of linePut labels and fields in a two-column table
Can't pick from the drop-downThe form isn't protected yetRestrict editing to filling in forms (Lesson 24)

Exercise

Now it's time to build a form yourself.

Click New in the sandbox title bar, and type these paragraphs:

  • Workshop Sign-Up
  • Name:
  • I will attend
  • T-shirt size:

Now do each task and press Check.

What to remember

  • Legacy form fields (text, check box, drop-down) are simple fields for forms filled in inside Word.
  • Content controls are the modern version, with dates, pictures, and placeholder text.
  • In Microsoft Word, both are on the Developer tab; in the sandbox, find Form Fields on the Insert tab.
  • Double-click a field to set its properties: name, default text, length, and drop-down choices.
  • Use a table to line up labels and fields.

In the next lesson, you'll link forms to XML data and protect documents so only the right parts can be changed.