Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How to make a Tree-branching kind of solution to find answers?

Featured Replies

I want to setup a solution to find answers by elimination.
For instance, starting off with the most basic and obvious question. Then if the answer is yes the user will be moved on to the next question, or given an answer. And so forth. Some answers may have exceptions.
I know the basics of forms and inputs, but I have never needed to make a form. And most importantly I don't know exactly how to setup the "if this, then that. Otherwise, this." part (the background logic).

I would appreciate it if someone could share some leads.

Thanks in advance guys,

JDL

I've recently built a form like this for a company.

 

What I did was create an matrix (array) with all the paths mapped out. I then use JS to manage the form inputs.

 

For example, If Q1 has A and B answers the array knew to go to Q2 for A and Q3 for B.

 

The actual form was quite simple - essentially a div to hold the question and the inputs. The inputs were checkboxes, radio fields, drop downs and the occasional text input.

 

The longest part was building the matrix. Once that was sorted the rest was just coding.

  • Author

Thanks for sharing fisicx :)

I am just about to start learning JS. It seems I have a long way to go.

At least I don't have a deadline for that ;)

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.