Update inputs from JS on document load

This commit is contained in:
Joel Collins 2018-11-09 16:48:05 +00:00
parent 740bf8fb68
commit 3a35e7f03c
2 changed files with 9 additions and 6 deletions

View file

@ -29,11 +29,14 @@ var fovY = 3146;
window.onload = function() {
getStagePositions()
updateTextBoxes()
}
function updateTextBoxes() {
document.getElementById('stageVelocityText').value = stageVelocity;
document.getElementById('stageVelocityInput').value = stageVelocity;
document.getElementById('focusVelocityText').value = focusVelocity;
document.getElementById('focusVelocityInput').value = focusVelocity;
document.getElementById('fovXText').value = fovX;
document.getElementById('fovYText').value = fovY;

View file

@ -28,14 +28,14 @@
<div class="clearfix">
<div class="left-col">FOV width:</div>
<div class="right-col">
<input type="text" id="fovXText" value="4100" size="4" onchange="fovX = Number(this.value); updateTextBoxes();">
<input type="text" id="fovXText" size="4" onchange="fovX = Number(this.value); updateTextBoxes();">
</div>
</div>
<div class="clearfix">
<div class="left-col">FOV height:</div>
<div class="right-col">
<input type="text" id="fovYText" value="3146" size="4" onchange="fovY = Number(this.value); updateTextBoxes();">
<input type="text" id="fovYText" size="4" onchange="fovY = Number(this.value); updateTextBoxes();">
</div>
</div>
</p>
@ -54,15 +54,15 @@
<div class="clearfix">
<div class="left-col">x-y:</div>
<div class="right-col">
<input type="range" name="stageVelocityInput" min="50" max="200" value="100" oninput="stageVelocity = Number(this.value); updateTextBoxes();">
<input type="text" id="stageVelocityText" value="100" size="3" disabled>
<input type="range" id="stageVelocityInput" min="50" max="200" oninput="stageVelocity = Number(this.value); updateTextBoxes();">
<input type="text" id="stageVelocityText" size="3" disabled>
</div>
</div>
<div class="clearfix">
<div class="left-col">z:</div>
<div class="right-col">
<input type="range" name="focusVelocityInput" min="10" max="100" value="20" oninput="focusVelocity = Number(this.value); updateTextBoxes();">
<input type="text" id="focusVelocityText" value="20" size="3" disabled>
<input type="range" id="focusVelocityInput" min="10" max="100" oninput="focusVelocity = Number(this.value); updateTextBoxes();">
<input type="text" id="focusVelocityText" size="3" disabled>
</div>
</div>