Open tristanthar opened 5 years ago
I'm trying to implement a file upload functionality with vex.
This is my code (taken from the documentation): vex.dialog.open({ message: 'Select your document', input: [ '<div class="ed-modal-input-field-wrapper">', '<label for="ed_doc">Document</label>', '<div class="ed-modal-input-wrapper">', '<input name="ed_doc" id="ed_doc" type="file" />', '</div>', '<p><small>Accepted file formats: .docx, .doc and .otf</small></p>', '</div>' ].join(''), callback: function(data) { if (!data) { return console.log('Cancelled') } console.log('File', data.ed_doc) console.log(data); } });
vex.dialog.open({ message: 'Select your document', input: [ '<div class="ed-modal-input-field-wrapper">', '<label for="ed_doc">Document</label>', '<div class="ed-modal-input-wrapper">', '<input name="ed_doc" id="ed_doc" type="file" />', '</div>', '<p><small>Accepted file formats: .docx, .doc and .otf</small></p>', '</div>' ].join(''), callback: function(data) { if (!data) { return console.log('Cancelled') } console.log('File', data.ed_doc) console.log(data); } });
However this always returns "undefined" in the callback function.
Are file inputs something that can be done with Vex?
I am also having this issue and am interested in whether it is possible.
I'm trying to implement a file upload functionality with vex.
This is my code (taken from the documentation):
vex.dialog.open({ message: 'Select your document', input: [ '<div class="ed-modal-input-field-wrapper">', '<label for="ed_doc">Document</label>', '<div class="ed-modal-input-wrapper">', '<input name="ed_doc" id="ed_doc" type="file" />', '</div>', '<p><small>Accepted file formats: .docx, .doc and .otf</small></p>', '</div>' ].join(''), callback: function(data) { if (!data) { return console.log('Cancelled') } console.log('File', data.ed_doc) console.log(data); } });
However this always returns "undefined" in the callback function.
Are file inputs something that can be done with Vex?