I got to this point: I have this js line: $( “#myElement” ).click(); which spouse to trigger in my case picture uploader, however haven’t managed to make it work yet. I think it is something to do with element ID. Maybe you would know how do I define it?
Is there a way to trigger a picture upload through a button or icon instead of picture uploader?
If you click to edit the element, there should be an element ID field at the very bottom.
If there isn’t, then you’d need to go to the editor and turn on element IDs (it’s in settings and near SEO options)
As direct above, give your picture uploaded the an ID, in my example let’s say it’s
That should do the trick
thanks, however it doesn’t seem like working ether.
maybe it possible can not locate the element in the document?
document.getElementById( ‘id-name’ ).getElementsByTagName( ‘input’ ).click();
I hope that helps.
I defined an ID for my picture uploader however I am not sure what tag name means. I used input, picture uploader, picture and it didn’t work. When I use the code without getting the element’s tag name it still doesn’t work.
Hey, just use this java code: $(’#pictureuploader input’).click()
where pictureuploader is your ID attribute.
with the code:
you only need to change id-name for your id you have set in bubble, the rest is just targeting the input within the object… in other words you don’t need to change the TagName.
@d.norkus solution is doing the same thing just using jQuery which will also work.
I get an invalid token error if I don’t check “Asynchronous” but either way still no result. Here is a test app:
What I am doing wrong?
I can’t access the app, I’d be happy to jump on a Skype call and help you get it working.
Instead of JS, you could use a default image or restyle the uploader so it looks like a button.
I also can’t view your app, however have you ticked on ID attribute checkbox in general settings? It could also produce an issue if element is placed in a repeating group or your browser is blocking pop ups… I can’t think of what more could be failing in this case.
Thanks everyone for replying. Here is the link to the app https://huhuhgkgkg.bubbleapps.io/version-test?debug_mode=true
But how can I share the app so you can view and edit it?
Goto Settings --> General --> Privacy & Security --> Application Rights --> Make it editable and share the link on address bar
Hi. Some time has passed and I forgot about this post. The problem was that I was hiding the pictureuploader ( I didn’t want it to be visible). Thanks for the help anyway.
doesnt work on mac osx chrome
It works with no problem when using file/picture uploader but when using the “Multi-file uploader” plugin from bubble I get the following error: “Cannot read property ‘click’ of undefined”
For anyone who still has this problem, I’ll share a solution. You can use this also for multi upload.
Just look at the css class of the input via inspect.
can you give more detail explanation? I need to trigger multifile uploader but have no idea with that css class…
Thanks for help