Reset form event

I have this form for table filters (using slime):

form(phx-submit="filter" phx-reset="clear")
  label Email
  input(type="text" name="email")

  label Name
  input(type="text" name="name")

  button(type="submit") Filter
  button(type="reset") Clear

When I click Clear button, form inputs are reset but I need to execute an action server (reset table list).
I have not see an phx-reset event on documentation. How could I do this?

1 Like

I have not used LiveView, but looking at the docs it looks like it’s possible to use phx-click.

It might be worth trying:

<button type=“reset” phx-click=“clear”>
1 Like