Added a listener so you can now hit 'enter' or 'return' on the keyboard to do the calculation
This commit is contained in:
parent
cc43efdd48
commit
9e381477e2
15
index.html
15
index.html
@ -13,7 +13,7 @@
|
||||
<h1>Machine 11 Die Calculator</h1>
|
||||
<p>Use this calculator to create setups for machine 11</p>
|
||||
</div>
|
||||
<div class="body">
|
||||
<div class="body" id="body">
|
||||
<input autocomplete="off" id="startSize" type="text" value="5.5" size="4" />
|
||||
<label for="startSize"> - Start size</label>
|
||||
<input type="radio" name="units" id="metric" value="mm" checked />
|
||||
@ -22,7 +22,7 @@
|
||||
<label for="inches">in</label>
|
||||
<br />
|
||||
<input autocomplete="off" id="finalSize" type="text" value=".000" size="4" />
|
||||
<label for="finishSize"> - Final size</label>
|
||||
<label for="finalSize"> - Final size</label>
|
||||
<br />
|
||||
<input autocomplete="off" id="coilerTarget" type="text" value="10" size="1" />
|
||||
<label for="coilerTarget">% - Coiler Target ROA</label>
|
||||
@ -30,9 +30,18 @@
|
||||
<input autocomplete="off" id="machineMaxReduction" type="text" value="20" size="1" />
|
||||
<label for="machineMaxReduction">% - Machine Max ROA</label>
|
||||
<br />
|
||||
<input type="button" value="Create Setup" onclick="getDies()" />
|
||||
<input type="button" value="Create Setup" onclick="getDies()" id="submitButton" />
|
||||
<input type="button" value="Clear" onclick="clearScreen()" />
|
||||
<br />
|
||||
<script>
|
||||
var input = document.getElementById("body");
|
||||
input.addEventListener("keypress", function (event) {
|
||||
if (event.key === "Enter") {
|
||||
event.preventDefault();
|
||||
document.getElementById("submitButton").click();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<br />
|
||||
<table class="dieSetup">
|
||||
|
Loading…
x
Reference in New Issue
Block a user