I’m converting a Google Sheets that collects several data inputs from the user and then does a lot of calculations. I know have to convert it to a webpage and tie it to an SQL database.
I’m using jquery to manipulate the calculable data on the web page, and I’m good with the SQL.
I’ve worked with Javascript years ago and am a little rusty. I just need a little jump start.
I have created a table of 5 rows that captures the square feet (SF) of three space types.
Space Type is a drop-down
Floor Area is an with type = number.
% Area is calculated (Floor Area รท Total Area)
The rest are DIVs and the calculation will show in their respective column,.
% Area will calulate the repsetive spaces floor area are show in that row’s cell.
kWh Used will use a value associated with a Space Type and multiply that by the Floor Area, e.g. Office = 21 kWh x 20,000 SF will show 420,000 kWh uused in the cell under kWh Used in row 1.
I’ve used document.getElementById() in the past, however the syntax is a bit different with jquery. I’m good with reference material that shows examples. So if someone knows of a online soycers please point me to it and I should be able to work my way through this.
My question is, how do I capture the text in Space Type and Floor Area and show the results of the %Area? If I can understgand. that I can probably figure the rest out.
-----------+------------+--------+----------+----------
Space Type | Floor Area | % Area | kWh Used | kWh Cost
-----------+------------+--------+----------+----------
Office | 20,000 | 12% | 50,000 | $5,000
-----------+------------+--------+----------+----------
Hotel | 150,000 | 87% | 120,000 | $12,000
-----------+------------+--------+----------+----------
Retail | 2,000 | 1% | 19,000 | $1,900
-----------+------------+--------+----------+----------
Total | 100% | 241,000 | $18,900
-----------+------------+--------+----------+----------