到目前为止,我没有成功让第一个输入按钮启动表移位功能。目前我正在测试功能。我已经尽力通过一些教科书和在线搜索来查看格式,我认为我的语法是正确的。寻找关于为什么没有从按钮计算班次引用 tableShifts() 的建议。谢谢你。
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<HTML>
<HEAD>
<TITLE>Couch Shifts</TITLE>
<script type="text/javascript">
function openWindow()
{
window.open('','',"toolbar=no, menubar=no, directories=no, status=no, resizable=no, scrollbars=no, height=120,width=510");
}
function patientPosition()
{
var x = 1;
var Position = document.getElementbyId("Position").value;
switch (patPosition){
case "HFS":
x = x*1
case "HFP":
x = x*-1
case "FFS":
x = x*1
case "FFP":
x = x*-1
}
}
function tableShifts()
{
alert("test");
}
function parameters()
{
var curVert = Number(document.getElementById("curVert").value),
var curLat = Number(document.getElementById("curLat").value),
var curLong = Number(document.getElementById("curLong").value),
var pinVert = Number(document.getElementById("curVert").value),
var pinLat = Number(document.getElementById("curVert").value),
var pinLong = Number(document.getElementById("curVert").value);
document.getElementById("gotoVert").value = curVert - pinVert;
document.getElementById("gotoLat").value = curLat + pinLat;
document.getElementById("gotolong").value = curLong - pinLong;
}
</script>
</HEAD>
<BODY>
<select Id="Position">
<option value="HFS">Head First Supine</option>
<option value="HFP">Head First Prone</option>
<option value="FFS">Feet First Supine</option>
<option value="FFP">Feet First Prone</option>
</select><br><br>
<div style="margin-bottom: 120px;">
<style>
label { float: left; width: 35px; }
#column1{ float: left; position: relative; z-index: 0; width: 150px;}
#column2{ float: left; position: relative; z-index: 2; width: 150px;}
#column3{ float: left; position: relative; z-index: 1; width: 125px;}
#button { position: absolute; }
</style>
<div id="column1">Current Position</br></br>
<label for="Vert">Vert:</label>
<input type="text", id="curVert" size="10" value="" /></br>
<label for="Lat">Lat:</label>
<input type="text" size="10", id="curLat" value="" /></br>
<label for="Long">Long:</label>
<input type="text" size="10", id="curLong" value="" />
</div>
<div id="column2">Pinnicle Shifts<br><br>
<label for="Vert">Vert:</label>
<input type="text", id="pinVert" size="10" value="" /></br>
<label for="Lat">Lat:</label>
<input type="text", id="pinLat" size="10" value="" /></br>
<label for="Long">Long:</label>
<input type="text", id="pinLong" size="10" value="" />
</div>
<div id="column3">Calculated Shifts</br></br>
<label for="Vert">Vert:</label>
<input type="text", id="gotoVert" size="10" value="" readonly="readonly" style="background-color:#D8D8D8 ;"/></br>
<label for="Lat">Lat:</label>
<input type="text", id="gotoLat" size="10" value="" readonly="readonly" style="background-color:#D8D8D8 ;"/></br>
<label for="Long">Long:</label>
<input type="text", id="gotoLong" size="10" value="" readonly="readonly" style="background-color:#D8D8D8 ;"/>
</div><br />
</div>
<div id="button">
<input type = "button" style="margin-top: 10px;" value="Calculate Shifts" onclick="tableShifts();" />
<input type = "button" style="margin-top: 10px;" value="Reset" onclick=""/>
</div>
</BODY>
</HTML>