Adding select components

It is customary to use people's titles in salutations in correspondence. To enable this on our form we're going to set up a drop-down list of titles for our speakers to select from.

How to do it...

  1. On the components overview page, drag the empty component row up to just above First name in the Speaker Details fieldset.
  2. Add a mandatory Select options component with the name of title.
  3. In the required Options textarea on the settings page, let's enter the following options, each one on its own line. Note that the pipe, that is, the vertical line separating the entries on each line is often found on the backslash key () on the keyboard:
    Mr|Mr
    Mrs|Mrs
    Ms|Ms
    Dr|Dr
    Prof|Prof
    Hon|Hon
    Rev|Rev
    
  4. In the Display section of the settings we need to check the Listbox option before saving the component.

There's more...

The options as we have entered them previously tell Webform two things about each option. The first section to the left of the pipe separator is the internal key associated with an option, while the text to the right of the pipe separator is the option text that our form users will see. Each option must be placed on its own line so that Webform can accurately determine how to handle each option.

The Select options component type is one of the most complex and flexible of the Webform components. It permits us to create single-select drop-down lists as we did previously, radio button lists which will allow only one selection to be made from a list, multiple-select checkbox list, or multiple-select drop-down lists.

As daunting as this may seem at first glance, the functionality is quite logical in its implementation and we'll cover the other variations as we develop our form.

Phase one complete

This is as far as we're going to go in terms of adding components to our form right now. In later chapters, we will develop the form further.

Let's click on the View tab to see what we have created thus far:

Phase one complete

The basic version of our form is ready for testing. Before we do test it though, let's configure a reply e-mail that will be sent to users who complete a successful submission.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset