Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ <h5 class="modal-title" id="newProductModalLabel">New Product</h5>
></button>
</div>
<div class="modal-body">
<form>
<form id="product-form">
<div class="form-row">
<div class="col">
<input
Expand Down
5 changes: 5 additions & 0 deletions code/celo101-code-chapter_3/3-6-pay-function/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ function notificationOff() {
document.querySelector(".alert").style.display = "none"
}

function resetForm() {
document.getElementById("product-form").reset()
}

window.addEventListener("load", async () => {
notification("⌛ Loading...")
await connectCeloWallet()
Expand Down Expand Up @@ -190,6 +194,7 @@ document.querySelector("#marketplace").addEventListener("click", async (e) => {
notification(`🎉 You successfully bought "${products[index].name}".`)
getProducts()
getBalance()
resetForm()
} catch (error) {
notification(`⚠️ ${error}.`)
}
Expand Down