From 7baedf79ca938ff0250e1387787b626437add837 Mon Sep 17 00:00:00 2001 From: 13Sharad <143598174+13Sharad@users.noreply.github.com> Date: Mon, 28 Oct 2024 22:18:13 +0530 Subject: [PATCH] Update index.html --- templates/index.html | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/templates/index.html b/templates/index.html index c228b37..59ecd6e 100644 --- a/templates/index.html +++ b/templates/index.html @@ -266,6 +266,13 @@

Buy Stock

+ +
+

Sell Stock

+ + + +
@@ -313,6 +320,18 @@

Buy Stock

alert('Stock purchased successfully!'); }); + // Handle Sell Stock Form submission + document.getElementById('sellStockForm').addEventListener('submit', async (event) => { + event.preventDefault(); + const stockName = event.target.stockName.value; + const quantity = event.target.quantity.value; + // Here you would typically check the user's balance for the stock and proceed with the sale + // Simulating a successful sale for demonstration purposes + alert(`Successfully sold ${quantity} shares of ${stockName}!`); + console.log(`Selling Stock: ${stockName}, Quantity: ${quantity}`); + }); + + // Button actions document.getElementById('viewOwnershipBtn').addEventListener('click', () => { alert('Feature not implemented yet!');