Pages
Overview
Most apps have more than one screen. A music app might have a home screen, a search screen and a settings screen. In a Form, each screen is a Page. In this tutorial, you will add Pages to a Form, move between them with buttons, and carry what a person typed on one Page over to the next. You will also think about what information an app should ask for at all, and about a real law that answers part of that question for children.
Goals
You have the following goals for this lesson:
By the end of this lesson, you can
- Add Pages to a Form and move between them with buttons
- Remember values of different types, such as text, numbers and true or false, across Pages
- Decide what personal information a sign-up form really needs
- Debate whether a real law, COPPA, and its self-regulatory safe harbor do a good job of protecting children's data
Warm up
Think of a time you signed up for something online, such as a game, a club or a newsletter. What did it ask you for? Was there anything it asked for that it didn't seem to need? Did it show you what you had entered before you finished?
Vocabulary
You will be learning about the following vocabulary words:
| Term | Definition |
|---|---|
| Page | One screen of a Form. A Form shows one Page at a time. |
| Title | Words at the top of a Page that say what it is. A screen reader can read it. |
| Data Type | The kind of value a variable holds, such as text, an integer, a number, or a boolean (true or false). |
| Personal Data | Information about a person, such as their name, age, or where they live. |
| Regulation | A rule made by a government that people or companies must follow. |
New Code to Learn
You will be using the following new pieces of code:
| Quorum Code | Code Example | Explanation |
|---|---|---|
| FORM:AddPage(NAME) | Page help = form:AddPage("Help") | Adds a new Page to the Form and returns it. |
| FORM:GetPage(NAME) | Page help = form:GetPage("Help") | Gets the Page with this name. The main Page is named Main. |
| FORM:SetPage(NAME) | form:SetPage("Help") | Shows the Page with this name. |
| PAGE:SetTitle(TEXT) | page:SetTitle("Help") | Adds a title to the top of the Page. |
| GetForm() | Form form = GetForm() | Inside a FormBehavior, gets the Form. |
| EVENT:GetItem() | Item pressed = event:GetItem() | Inside a behavior, gets the control that was used, such as the button that was pressed. |
| FORM:SetText(NAME, VALUE) | form:SetText("name", "Ada") | Remembers a text value under a name. |
| FORM:SetInteger(NAME, VALUE) | form:SetInteger("tickets", 2) | Remembers an integer under a name. |
| FORM:SetBoolean(NAME, VALUE) | form:SetBoolean("group price", true) | Remembers a boolean under a name. |
| FORM:GetText(NAME) | form:GetText("name") | Gets the text value remembered under this name. There are also GetInteger and GetBoolean. |
CSTA Standards
This lesson covers the following CSTA K–12 standards:
For teachers · 2026 CSTA K–12 Computer Science Standards
High School · Data & Analysis
Debate the efficacy of a policy or regulation to ensure responsible data use.
Only this lesson so far
Middle School · Algorithms & Design
Design an algorithm that includes variables of multiple data types to solve a problem or express an idea.
Only this lesson so far
Middle School · Programming
Use variables of multiple data types to store, access, and manipulate data within a program.
Also in 6 other lessons
Middle School · Data & Analysis
Explain the benefits and risks of allowing personal data and metadata to be collected and used in datasets, including issues of data ownership, privacy, and sovereignty.
Also in 1 other lesson
Explore
In the Forms tutorial, you built an app with one Page, the main Page. In Behaviors and Buttons, you made buttons that change a label on that Page, and you let one behavior serve many buttons. Now you will use buttons to move between Pages. A Form can hold many Pages, but it shows only one at a time. Each Page has a name. The main Page is always named "Main".
An app with more than one Page
form:AddPage(name) makes a new Page and gives it back to you, so you can
add controls to it, just as you did with the main Page. form:SetPage(name) shows the Page with that name, and hides the one that
was showing. form:GetPage(name) gives you a Page by its name, whether it
is showing or not.
This app is a made-up guide to a park, with three Pages. Buttons move between them.
use Libraries.Interface.Forms.Form
use Libraries.Interface.Forms.Page
use Libraries.Interface.Forms.FormBehavior
use Libraries.Interface.Events.BehaviorEvent
use Libraries.Interface.Controls.Button
use Libraries.Interface.Item
class Main is FormBehavior
action Main
Form form
Page home = form:GetMainPage()
home:SetTitle("Park Guide")
home:AddLabel("Welcome", "Welcome to the park. Where would you like to go?")
Button trailsButton = home:AddButton("Trails")
trailsButton:SetBehavior(me)
Button hoursButton = home:AddButton("Opening hours")
hoursButton:SetBehavior(me)
Page trails = form:AddPage("Trails")
trails:SetTitle("Trails")
trails:AddLabel("Lake trail", "Lake Trail: 2 miles, flat")
trails:AddLabel("Hill trail", "Hill Trail: 4 miles, steep")
Button backFromTrails = trails:AddButton("Back to Home")
backFromTrails:SetBehavior(me)
Page hours = form:AddPage("Hours")
hours:SetTitle("Opening hours")
hours:AddLabel("Daily hours", "Open every day from 8 to 6")
Button backFromHours = hours:AddButton("Back to Home")
backFromHours:SetBehavior(me)
form:Display()
end
action Run(BehaviorEvent event)
Form form = GetForm()
Item pressed = event:GetItem()
text name = pressed:GetName()
if name = "Trails"
form:SetPage("Trails")
elseif name = "Opening hours"
form:SetPage("Hours")
else
form:SetPage("Main")
end
end
end
All four buttons use the same Run action, as the color buttons did in the
Buttons tutorial. To tell them apart, Run asks the event which control was
used: event:GetItem() gives back the button that was pressed, and GetName() gives its name. Every Item has a name, so there is no need to
cast it to a Button here. The two "Back to Home"
buttons share a name, and they do the same thing, so Run doesn't need to
tell them apart.
When a new Page appears, the Form moves the focus to the first thing on it
that can take the focus. A title can take the focus, so giving each Page a
title with SetTitle lets a screen reader user find out which Page they
are on as soon as it appears. Each Page also gets its own Tab order, from top to
bottom, just like the main Page.
Remembering values across Pages
When a person types on one Page and then moves to another, the app often needs what they typed. A Form can remember values for you, each under a name you choose. There is an action for each data type, the kind of value being stored:
| Type | To remember | To get it back |
|---|---|---|
| text | form:SetText(name, value) | form:GetText(name) |
| integer | form:SetInteger(name, value) | form:GetInteger(name) |
| number | form:SetNumber(name, value) | form:GetNumber(name) |
| boolean | form:SetBoolean(name, value) | form:GetBoolean(name) |
This made-up app orders movie tickets. The first Page asks for a name, in a text field, and has buttons to add and remove tickets. The second Page shows the order back so the person can check it. In this made-up app, an order of 4 or more tickets gets a group price. The app uses three data types: the name is text, the number of tickets is an integer, and whether the order gets the group price is a boolean.
use Libraries.Interface.Forms.Form
use Libraries.Interface.Forms.Page
use Libraries.Interface.Forms.FormBehavior
use Libraries.Interface.Events.BehaviorEvent
use Libraries.Interface.Controls.Button
use Libraries.Interface.Controls.TextField
use Libraries.Interface.Item
use Libraries.Game.Graphics.Label
class Main is FormBehavior
action Main
Form form
form:SetInteger("tickets", 1)
Page order = form:GetMainPage()
order:SetTitle("Movie Tickets")
order:AddLabel("Name prompt", "Your name")
order:AddTextField("Your name")
order:AddLabel("Tickets", "Tickets: 1")
Button addButton = order:AddButton("Add a ticket")
addButton:SetBehavior(me)
Button removeButton = order:AddButton("Remove a ticket")
removeButton:SetBehavior(me)
Button reviewButton = order:AddButton("Review my order")
reviewButton:SetBehavior(me)
Page review = form:AddPage("Review")
review:SetTitle("Check your order")
review:AddLabel("Name result", "Name:")
review:AddLabel("Tickets result", "Tickets:")
review:AddLabel("Group result", "Group price:")
Button changeButton = review:AddButton("Change my order")
changeButton:SetBehavior(me)
form:Display()
end
action Run(BehaviorEvent event)
Form form = GetForm()
Item pressed = event:GetItem()
text name = pressed:GetName()
integer tickets = form:GetInteger("tickets")
if name = "Add a ticket"
if tickets < 10
form:SetInteger("tickets", tickets + 1)
end
ShowTickets(form)
elseif name = "Remove a ticket"
if tickets > 1
form:SetInteger("tickets", tickets - 1)
end
ShowTickets(form)
elseif name = "Review my order"
Page order = form:GetPage("Main")
TextField nameField = order:GetTextField("Your name")
form:SetText("name", nameField:GetText())
form:SetBoolean("group price", tickets >= 4)
ShowReview(form)
form:SetPage("Review")
else
form:SetPage("Main")
end
end
action ShowTickets(Form form)
Page order = form:GetPage("Main")
Label ticketLabel = order:GetLabel("Tickets")
ticketLabel:SetText("Tickets: " + form:GetInteger("tickets"))
end
action ShowReview(Form form)
Page review = form:GetPage("Review")
Label nameLabel = review:GetLabel("Name result")
nameLabel:SetText("Name: " + form:GetText("name"))
Label ticketLabel = review:GetLabel("Tickets result")
ticketLabel:SetText("Tickets: " + form:GetInteger("tickets"))
Label groupLabel = review:GetLabel("Group result")
if form:GetBoolean("group price")
groupLabel:SetText("Group price: Yes")
else
groupLabel:SetText("Group price: No")
end
end
end
Here is how the values are stored, changed and moved from one Page to the next:
- At the start,
Mainremembers the integer 1 under the name "tickets", before the Form is shown. - When "Add a ticket" or "Remove a ticket" is pressed,
Rungets the integer back, adds or takes away one, and remembers the new value. Theifstatements keep it between 1 and 10.ShowTicketsthen puts the new count in the label, so a person can Tab to it and find the count. - When "Review my order" is pressed,
Runfinds the text field on the main Page by its name, gets the text typed in it, and remembers it as "name". tickets >= 4is a comparison, so its value is a boolean:trueorfalse.Runremembers it as "group price". This boolean isn't typed by anyone; the app works it out from the integer.ShowReviewgets each value back and puts it in a label on the review Page. A boolean needs a decision:ifturns true into "Yes" and false into "No", which is easier to read.- Then
SetPageshows the review Page.
Press "Change my order" and you're back on the main Page, with everything
you typed still there. A Page keeps its controls, and what's in them, while
it is hidden. That means you could also read a control on another Page
directly, with form:GetPage("Main") and then GetTextField. Remembering
values on the Form keeps them all in one place, under clear names, so any
Page can use them.
Always remember a value before you try to get it. If you ask for a name
that was never set, Quorum stops with a message that lists the names that
do exist. That is why Main sets "tickets" before anything else.
Ask only for what you need
Every text field on a sign-up form asks a person to hand over a piece of personal data. Collecting it has benefits: a club needs your name to know who joined, and a reminder needs a way to reach you. It also has risks. Data that is stored can be shared, sold, or stolen, and the person may lose control over who gets it and how it is used.
When you design a form, a few questions help:
- Do we need it? Ask for each piece of data only if the app uses it. The movie ticket app asks for a name, but not a birthday or an address, because it doesn't use them.
- Is it the person's choice? Something extra, like a phone number for reminders, can be optional. Say so in its label or description, and make sure the app still works when it is left empty. The Checkboxes tutorial shows another way to let a person opt in.
- Can they check it? A summary Page, like "Check your order", lets a person review everything they entered, and go back to change it, before anything is sent.
A real rule: COPPA
Some of these questions are answered by law. In the United States, the Children's Online Privacy Protection Act (COPPA), passed by Congress in 1998, protects children under 13. The Federal Trade Commission (FTC) writes and enforces the rule. It covers websites and apps aimed at children under 13, and others that know they are collecting a child's personal information. They must post a privacy policy, get a parent's permission before collecting a child's personal information, let parents review or delete it, keep it secure, and not require a child to share more than is reasonably needed to take part. Congress chose not to cover teenagers (source). The FTC updated the rule in 2025, and the update took effect on June 23, 2025. You can read the whole update in the government's official journal, the Federal Register: Federal Trade Commission, "Children's Online Privacy Protection Rule," document 2025-05904, April 22, 2025 (Federal Register).
The rule also has a safe harbor provision, which lets an industry regulate itself. In the law's words, industry groups can ask the FTC to approve "self-regulatory program guidelines": their own set of rules for the companies in the group. To be approved, the group's rules must give children "substantially the same or greater protections" than the FTC's rule. The group must check each member company's privacy and security practices at least once a year, and must discipline companies that break its rules, for example by reporting them publicly or referring them to the FTC. A company that follows an approved group's rules is treated as following the FTC's rule (16 CFR 312.11, "Safe harbor programs"; eCFR).
Notice that "ask only for what you need" is part of the law for children. Whether a rule like this works well is a fair question to debate: it depends on what it protects, who it leaves out, and whether companies can and do follow it. You will debate it in the activity below.
Engage
In this activity, you debate a real law, with a partner or as a class. There is no programming. Use only the facts in "A real rule: COPPA" and the movie ticket app from this tutorial as evidence.
Debate 1: does COPPA protect children's data well? One side argues that it does a good job; the other argues that it falls short. Questions to start with:
- If the movie ticket app were made for children under 10, what would it have to do differently? What about a 14-year-old, whom COPPA doesn't cover?
- Is asking a parent's permission enough?
- Does asking only for what is reasonably needed protect children, or can companies get around it?
After a few minutes, switch sides for one minute.
Debate 2: the safe harbor provision. Safe harbor is self-regulatory: industry groups write their own rules and check their own members. Debate questions like these:
- If an industry group regulates itself, is that reasonable oversight?
- Who should check that companies follow the rules: the government, the industry itself, or both?
- What could a self-regulatory group gain by being strict with its own members? What could it gain by being easy on them?
- Does the FTC's approval, the yearly checks and the discipline make self-regulation trustworthy enough to protect children?
Switch sides again for one minute.
To finish, write down the strongest point each side made in each debate, and one change to the rule you would suggest, with a reason.
Wrap up
Think about an app or website you use that asks for personal data. Which pieces does it really need to work, and which might it be collecting for another reason? What benefits do you get from sharing that data, and what risks come with it? How could its sign-up Pages make it clearer what is collected and why?
As your Pages fill up with controls, it helps to sort them into sections. The Groupings tutorial, next, shows how.