Hej,
Udregningerne skal måske tilpasses men det her giver vel en indikation af hvordan det kan laves...
<%
'1 sømil = 1,852 km
'1 knob = 1,852 km/t
function calcMiles(x,y)
calcMiles = x / y * 60
end function
function calcKm(x,y)
calcKM = 1.852 * Y ' er ikke sikker på jeg har forsået hvordan denne udregning skal laves...
end function
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="
http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<%
if request.ServerVariables("REQUEST_METHOD") = "POST" then
' kald funktion til udregning
if request.Form("calcMiles") <> "" then
response.Write(calcMiles(request.Form("calcMilesX"),request.Form("calcMilesY")))
end if
if request.Form("calcKM") <> "" then
response.Write(calcMiles(request.Form("calcKMx"),Request.Form("calcKMy")))
end if
end if
%>
<form method="post" action="" name="calcMilesXY">
X = <input type="text" value="" name="calcMilesX" /><br />
y = <input type="text" value="" name="calcMilesY" /><br />
<input type="submit" value="Udregn" name="calcMiles" />
</form>
<form method="post" action="" name="calcKM">
X = <input type="text" value="" name="calcKMx" /><br />
y = <input type="text" value="" name="calcKMy" /><br />
<input type="submit" value="Udregn" name="calcKM" />
</form>
</body>
</html>