Preventing Page reloads with ActionForm? #1002
Replies: 3 comments 6 replies
-
If you're getting a page reload with an ActionForm then I'm guessing WASM had not loaded yet or never loaded, which would also explain why your |
Beta Was this translation helpful? Give feedback.
-
Thanks - unfortunately this didn't seem to work :( the request to the server action never gets made with this approach. I'm sure it's something simple that I'm doing wrong :( Taking a step back for a minute, it looks like the This might be my lack of web dev experience speaking here, but how would this ever do anything other than direct the entire browser to the relative url in the |
Beta Was this translation helpful? Give feedback.
-
Also i neglected to notice this before but the Server Action appears to be returning a 303 which results in the page reload. Odd because the same action is being invoked elsewhere but it is returning a 200 and not causing the page to reload. This is odd because in both cases, the server action is returning |
Beta Was this translation helpful? Give feedback.
-
I'm trying to prevent page reloads upon submission of an ActionForm:
let on_submit = move |ev: SubmitEvent| { ev.prevent_default(); };
...
<ActionForm action=save on:submit=on_submit>
it seems like
on_submit
is never invoked, as far as I can tell.Is this expected? What's the best way to prevent a page reload upon submission of an
ActionForm
?Beta Was this translation helpful? Give feedback.
All reactions