top of page
Cascading Form

Cascading Form

Change the options of a dropdown based on a previous selection.

Intermediate.png

Intermediate

17K

Published:

January 1, 2020

Girl Enjoying her Drink

by

Anchor 1
Hire a Developer

Example Description

This example demonstrates change the options of a dropdown based on a previous selection.

Example Code

Tab 1

.

Tab 2

.

Tab 3

.

This code solution can be complicated.

How We Built It

This example demonstrates how to build a cascading form.

 

Cascading elements help users quickly refine their input while filling out fields in submission and search forms. Cascading is the operation of automatically populating a form element with options based on a previous selection.


Here the first dropdown element asks a user to select a country. The second dropdown element is populated dynamically with the states located in the selected country, or it’s disabled for countries without states.


We implement the cascade using the onChange event of the first dropdown. The state information is imported from the states.js file in the site’s Public section. In this example, the only countries with state or province information are the United States and Canada.


Next Steps


  1. Open this example in the Editor to work with the template.

  2. Publish the site.

  3. Learn how to work with examples in Velo.

APIs We Used

Non-code example.

Non-code example.

Related Articles

Article Link

Hire a Developer

Velo solutions are powerful tools, but building them on your own can be challenging. Let an experienced Velo development shop build it for you, so you can keep working on your site or business.

Related Examples

Did this help?

Yes

|

No

Thanks for your feedback!

Cascading Form

Cascading Form

Change the options of a dropdown based on a previous selection.

Intermediate.png

Intermediate

Multistage Form

Multistage Form

Create a form split into multiple steps.

Intermediate.png

Beginner

Basic Form

Basic Form

Create a basic form without writing a line of code.

Intermediate.png

Beginner

Collapsing Form

Collapsing Form

Collapse and expand sections of a form.

Intermediate.png

Beginner

Anchor 2
bottom of page