Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload file (base 64) not working in wizard #1290

Closed
marcopollacci opened this issue May 23, 2019 · 7 comments
Closed

Upload file (base 64) not working in wizard #1290

marcopollacci opened this issue May 23, 2019 · 7 comments

Comments

@marcopollacci
Copy link

Hi, i try to upload file by file input.
Everything it's ok in "normal" form, but when i try to wizard this is what appens:

File.js:853 Uncaught TypeError: Cannot read property 'querySelector' of null
at eval (File.js:853)
at Array.forEach ()
at FileComponent.upload (File.js:807)
at HTMLInputElement.onChange (File.js:305)
(anonymous) @ File.js:853
upload @ File.js:807
onChange @ File.js:305

var submitButton = _this14.root.element.querySelector('.formio-component-submit').querySelector('button');

image

@marcopollacci
Copy link
Author

I found that in wizard form, not exist "formio-component-submit" class but only "btn-wizard-nav-submit".

Another problem, it's in line 807... file it's not defined

image

@wag110894
Copy link
Contributor

wag110894 commented May 23, 2019

Hello,
Thanks for reaching out! We are aware of this issue on File Upload on Wizard. We have tagged you on the ticket for this issue and will let you know once it is resolved. For reference, the ticket number is FOR-2304.

Thanks.

@marcopollacci
Copy link
Author

For now, i just use a little workaround but i'm looking forward to fix ;)

@Daedrias
Copy link

Daedrias commented May 27, 2019

Hi @marcopollacci , we encountered the same issue on our side. Could you please share your workaround?

@marcopollacci
Copy link
Author

marcopollacci commented May 27, 2019

Hi @marcopollacci , we encountered the same issue on our side. Could you please share your workaround?

Oh..actually it's not really a great workaround...but i was in hurry and it works... :P
I've just added a try catch option

try{ var submitButton = _this14.root.element.querySelector('.formio-component-submit').querySelector('button') }catch{ var submitButton = _this14.root.element.querySelector('.btn-wizard-nav-submit') }

and if your upload field is in your last page of wizard form, it works :)

But, bad news if you have upload field in a different page than last, 'cause actually seems that only way to make thing work (after added try catch ) its to add an hidden submit button in the same page where upload field is. (really dirty and strange things)

@noman115pk
Copy link

@marcopollacci I have upload field in different pages than last, so i had to add a null check and bypass the #1096 where button gets disabled.

@marcopollacci
Copy link
Author

@marcopollacci I have upload field in different pages than last, so i had to add a null check and bypass the #1096 where button gets disabled.

I just add this too! Thank you!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants