Currently, I am developing an Inventory Manager system to keep track of a variety of fishing equipment. Through HTML forms, I am able to input data into a SQL server database. My goal is to load data from a select statement into a specific div on my index.html page. To achieve this, I am utilizing Node.js and Express to facilitate communication between the HTML interface and the SQL server.
index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Fishing Inventory</title>
</head>
<body>
<div class="navbar">
<a href="AddPerson.html">Add New Person</a>
<a href="AddHook.html">Add New Hook</a>
<a href="AddSoftPlastic.html">Add New Soft Plastic</a>
<a href="AddRod.html">Add New Rod</a>
<a href="AddReel.html">Add New Reel</a>
<a href="AddLine.html">Add New Line</a>
<a id="SeeHooks">See Hooks</a>
<a id="SeeSP">See Soft Plastics</a>
<a id="SeeRods">See Rods</a>
<a id="SeeReels">See Reels</a>
<a id="SeeLine">See Line</a>
</div>
<div class="mainHeader">
<h1>Fishing Inventory Manager</h1>
</div>
<div class="DBcontainer">
<form action="/" method="POST">
/* On button click, I want the recordSet to be displayed in this div */
<input type="submit" value="Submit"></input>
</form>
</div>
</body>
</html>
<style>
body {
background-color: black;
}
/* CSS styles omitted for brevity */
</style>
server.js
// Server-side JavaScript code handling requests and interactions with SQL database
// Code snippet provided here for reference
Note: For security reasons, the actual server name, username, and password have been altered in the code snippet above.