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:
| Tool | What it is | Best for |
|---|---|---|
| Legacy form fields | The classic text, check box, and drop-down fields | Simple forms that are filled in inside Word, with protection turned on |
| Content controls | Newer boxes for text, dates, lists, pictures, and check boxes | Modern 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.
- Click where the field should go, usually right after a label like
Name:. - Insert a Text Form Field (sandbox: Insert > Form Fields > Text).
- 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".
- Click where the check box should go, usually just before its label.
- 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.
- Click where the list should go.
- Insert a Drop-Down Form Field.
- 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:
| Control | What people do with it |
|---|---|
| Plain Text / Rich Text | Type text (Rich Text also allows formatting) |
| Check Box | Tick a box |
| Drop-Down List / Combo Box | Pick from a list (a combo box also lets them type their own answer) |
| Date Picker | Pick a date from a calendar |
| Picture | Insert 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:
| Property | What it does |
|---|---|
| Name or Title | Identifies the field, such as FullName |
| Default text | Text that appears before anyone types |
| Maximum length | Limits how many characters can be typed |
| Type | For text fields: regular text, number, date, and so on |
| Choices | For drop-downs: the list of options, in order |
| Checked by default | For 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:
| Mistake | What happens | How to fix it |
|---|---|---|
| Typing into the label area instead of a field | The answer becomes part of the form text | Add a field, and protect the form for filling in |
| Drop-down with no choices added | The list is empty | Double-click the field and add the choices |
Underscores ______ used as answer lines | Typing pushes the line and breaks the layout | Use a text form field instead |
| No table for layout | Fields drift out of line | Put labels and fields in a two-column table |
| Can't pick from the drop-down | The form isn't protected yet | Restrict 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-UpName:I will attendT-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.