Skip to content
Discussion options

You must be logged in to vote

Yes.

The answer to the question "How?" depends a lot on how much you already know about the various Web APIs involved, how comfortable you are accessing web APIs from Rust using the web-sys crate, etc.

Here's an example another user created that I found by searching in our Discord -- I don't take any credit for it.

#[component]
fn UploadFileForm<F>(on_upload_finished: F) -> impl IntoView
where
    F: Fn(bool) + 'static + Clone,
{
    let error: RwSignal<Option<Box<dyn Error>>> = create_rw_signal(None);
    let form_ref: NodeRef<html::Form> = create_node_ref();
    let on_submit = move |ev: SubmitEvent| {
        ev.prevent_default();
        let form = form_ref.get().expect("noform");

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@AndyJado
Comment options

@gbj
Comment options

gbj Jan 22, 2024
Maintainer

Answer selected by AndyJado
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants