Display upload image before submitting form
I'm trying to display the image that I have selected to upload before I click submit and then it should clear.
It's complaining about _clone -ing Html
Is this not possible?
4 Replies
The
element
passed to form
must be a UIElement
(something created under the namespace mo.ui
, but hstack
is not a UIElement
so you can't make a form out of it.
You could do mo.hstack([mo.md(...), ...)].batch(...).form()
.
But in your case, to display an uploaded image before submitting, this isn't the way to go — the figure name and file are only sent on form submit, so you can't use their values in the form, it's circular
I can send you what I would domarimo | a next-generation Python notebook
A reactive notebook for Python — run reproducible experiments, execute as a script, deploy as an app, and version with git.
Okay thanks! I guess if I want the button and the image to be next to each other I can do it in grid view.