Skip to content

Commit

Permalink
Update logic reset input
Browse files Browse the repository at this point in the history
  • Loading branch information
ChienNM3 committed Feb 10, 2024
1 parent acfac90 commit 2b3bfbb
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
10 changes: 9 additions & 1 deletion ui/index.templ
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,18 @@ templ Index() {
type="submit"
class="inline-flex justify-center items-center space-x-1 my-3 rounded bg-red-600 px-6 py-2 hover:bg-red-700 disabled:bg-stone-500 inline"
>
<span>{ i18n.T(ctx, "Home.GetInfoButton.Text")}</span>
<span>{ i18n.T(ctx, "Home.GetInfoButton.Text") }</span>
<img class="htmx-indicator w-6 h-6" src="/static/loading.svg"/>
</button>
</form>
<script>
document.querySelector("input[name='fileInput']").addEventListener("change", (e) => {
document.querySelector("input[name='textInput']").value = "";
});
document.querySelector("input[name='textInput']").addEventListener("input", (e) => {
document.querySelector("input[name='fileInput']").value = "";
});
</script>
</div>
</main>
}
Expand Down
18 changes: 17 additions & 1 deletion ui/index_templ.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2b3bfbb

Please sign in to comment.