I have a simple form with different types of fields. When submitting the form, I just print the submitted values.
It looks great for multiple fields, however it doesn't work as expected for multiselect and checkbox fields.
For multi selector and check boxes, only the last selected values are printed. Instead, I need an array.
Any suggestions on how to do this?
Also for the file attachment field, how can I add a list of files to the source object (created using FormBuilder and ControlGroup) with the rest of the field values?
this.SampleForm = formBuilder.group({
title: ['', Validators.required],
description: ['', Validators.required],
countries: ['', Validators.required],
attachment: ['', Validators.required],
continents: ['', Validators.required]
});
Plunker link


source
share