8 Generating site forms

 

This chapter covers

  • Dealing with text boxes and text areas
  • Working with check boxes and radio buttons
  • Adding selection lists and buttons to a form
  • Using the free Getform service to have form data sent to you
  • Crafting a ChatGPT prompt for building an event sign-up page
  • Examining and customizing the ChatGPT- generated code

Most web pages—and all the web projects so far in this book—are read-only media, meaning their purpose is to present each visitor with information related to the page’s main topic. Such pages require nothing of the visitor except their time and attention (which are big asks in these overly busy times!).

However, there are plenty of scenarios where you’ll want your page to be more interactive, meaning you ask users to provide you with some information. Perhaps you want to get feedback about your website. Maybe you want to present your visitors with a survey or quiz. Or maybe you want to offer folks a way to sign up for a newsletter or register for an upcoming event. Whatever the reason, you solicit such information by offering a form, which is a special web page object that has fields the visitor fills in and then submits.

8.1 Checking out this chapter’s project

8.2 Getting the form data sent to you

8.2.1 Setting up a Getform account

8.2.2 Creating a Getform endpoint

8.3 Building a form

8.3.1 Specifying the form’s endpoint

8.3.2 Gathering text with text boxes

8.3.3 Adding labels to each control

8.3.4 Handling more text with text areas

8.3.5 Getting yes-or-no info with check boxes

8.3.6 Choosing one of several options with radio buttons

8.3.7 Offering more selections with lists

8.3.8 Submitting the form with a button

8.4 Crafting the prompt for the event sign-up page

8.5 Examining the event sign-up page code

8.5.1 Examining the HTML

8.5.2 Examining the CSS

8.6 Customizing the event sign-up page

Summary