Open karlguillotte opened 7 years ago
I need to setup a form to post multiple files. I followed instruction from #112 and it is working well for one File.
File
Should get a list of files.
I am getting null.
null
So, here is my type
const Uploads = t.struct({ files: t.list(t.form.File) })
Because, I still want to use the html input and not an array, my options are
const options = { label: 'Step 2. Uploads', fields: { files: { factory: t.form.Textbox, type: 'file', attrs: { multiple: true, }, help: 'Add a photo to help tell your story.', } } }
Everything is fine until I call getValue on the form, I get null.
getValue
It returns a File with the type below.
const Uploads = t.struct({ files: t.form.File })
Any way to get an array of files? For input[type="file"] the onChange only send the first file and the list is available at input.files.
input[type="file"]
onChange
input.files
Thanks for your awesome tool!
Probably the source of my issue: https://github.com/gcanti/tcomb-form-templates-semantic/blob/master/src/textbox.js#L27
I need to setup a form to post multiple files. I followed instruction from #112 and it is working well for one
File
.Version
Expected behaviour
Should get a list of files.
Actual behaviour
I am getting
null
.Steps to reproduce
So, here is my type
Because, I still want to use the html input and not an array, my options are
Everything is fine until I call
getValue
on the form, I getnull
.It returns a
File
with the type below.Any way to get an array of files? For
input[type="file"]
theonChange
only send the first file and the list is available atinput.files
.Thanks for your awesome tool!