clear form if successful response

This commit is contained in:
Zynh0722 2023-11-15 12:48:37 -08:00
parent c30653f6fc
commit 6718f345ae

View file

@ -11,7 +11,7 @@
@:return_to_main_html() @:return_to_main_html()
</div> </div>
<form hx-post="/api/dancers" hx-target="next #dancer_list" hx-swap="afterbegin"> <form hx-post="/api/dancers" hx-target="next #dancer_list" hx-swap="afterbegin" hx-on::after-request=" if(event.detail.successful) this.reset()">
<div class="flex w-3/5"> <div class="flex w-3/5">
<div class="relative"> <div class="relative">
<input type="text" id="name" name="name" <input type="text" id="name" name="name"