-1

I'm looking for how to make new options appear in the form as the users answer it.

For exmaple, let's say I have a drop list "gender" with the options "male", "female", and "robot". If the user choose "male" or "female", a check list would appear under the drop list with the option "married", "single".

If the user choose "robot" instead, it would appear a checklist under the drop list with the options "first generation" and "second generation".

How should I do this? Is there a specific name for this kind of form?

Pika Supports Ukraine
  • 3,612
  • 10
  • 26
  • 42
kalil
  • 21
  • 3

1 Answers1

0

You need to override the onchange event for your select, check the value inside the function and show the appropriate options.

If you're using a framework like Angular you can just use *ngIf.

Eytan
  • 140
  • 8
  • Man i have been looking how to use "onchange" for forms but nothing i try is working, can you pass me a good tutorial? – kalil Mar 12 '19 at 18:44