liveBook · Manning

Radio group

As explained in Build a Website with ChatGPT

A radio button group is a set of mutually exclusive radio buttons from which a user can select exactly one option.

A radio group is a set of HTML radio buttons for choosing exactly one option. Each button appears as a circle; selecting one clears the previous selection. section 8.3.6

Use a radio group when:

  • Visitors must choose one of three or four options, such as a day or shirt size. section 8.3.6
  • You want one option selected initially; specify that choice in the form prompt. section 8.3.6
  • You need to identify the choices with a legend caption, such as “Choose a t-shirt size.” section 8.3.6
  • You have five or more options; use a selection list instead. section 8.3.6 section 8.7

T-shirt size

A form can offer Small, Medium, Large, and Extra Large, with Medium selected when the form first opens. Ask for a legend caption such as “Choose a t-shirt size.” section 8.3.6

A group of radio buttons with the following options: "Small", "Medium", "Large", and "Extra Large". Include a legend element with the caption "Choose a t-shirt size".

Inspect a prompt that requests the four shirt-size options, an initially selected Medium choice, and a descriptive legend. section 8.3.6

How Build a Website with ChatGPT covers it

How deep it goes
Defines mutual exclusion and selection behavior, then stops short of detailed HTML implementation.
Examples
Uses t-shirt sizes, an initially selected Medium choice, and an event sign-up form.
What you can do after
Apply it via an HTML form prompt that requests options, an initial selection, and a legend caption.
How it connects
Connects HTML forms, legends, selection lists, and form submission.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build a Website with ChatGPT. The section links point to the parts of the book it draws on.