Toggle menu

Showing and Hiding Fields

The form at the bottom of this page has two hidden fields. The fields are shown or hidden when the value of the checkbox fields change. When the form first loads the fields are hidden using the "Page Init Handler".

All show and hide behaviour is performed browser-side using JavaScript. If JavaScript is disabled in a user's browser, all fields will be visible.

Tutorial

Using the Script Editor - Showing and Hiding Form Fields is a step by step guide to showing and hiding fields.

Hiding the Fields Initially

When the page first loads, the page initialisation handler hides all of the fields we don't want to see.

Page Init

Hiding Fields

Showing and Hiding the Fields

Each of the checkbox fields has a handler. The handler is triggered when the box is checked or cleared.

Handler

Note how when fields are hidden we're also clearing their values by setting them back to empty strings.

Share this page

Facebook icon Twitter icon email icon

Print

print icon