1
2
3<form id="frm1" action="Calculate.html">
4 <table width="350px" border="1px">
5 <tr>
6 <th colspan="2">Availability</th>
7 </tr>
8 <tr>
9 <td>Total Production Time</td>
10 <td>
11 <input type="number" id="TotalProductionTime" placeholder="">hours</td>
12 </tr>
13 <tr>
14 <td>Breaks</td>
15 <td>
16 <input type="number" id="Breaks" placeholder="">minutes</td>
17 </tr>
18 <tr>
19 <td>Malfunctions</td>
20 <td>
21 <input type="number" id="Malfunctions" placeholder="">minutes</td>
22 </tr>
23 <tr>
24 <td>Theoretical production time:</td>
25 <td>
26 <p id="test"></p>
27 </td>
28 </tr>
29 </table>
30 <input type="button" onclick="Calculate()" value="calculate">
31</form>
32
33
34function Calculate() {
35 var TotalProductionTime = document.getElementById("TotalProductionTime").value;
36 var TotalProductionTimeInMinutes = TotalProductionTime * 60;
37 var Breaks = document.getElementById("Breaks").value;
38 var Malfunctions = document.getElementById("Malfunctions").value;
39 var TheoreticalProductionTime = TotalProductionTimeInMinutes - Breaks - Malfunctions;
40
41 document.getElementById("test").innerHTML = TheoreticalProductionTime;
42}