Hi,
I am new to this forum and have recently started to explore Javascript functionality to create little 'programs' to help me with my hobby as a private pilot.
One of the applications I have in mind simply makes a timestamp of different flight phases when the pilot presses the relevant button (before taxi, before takeoff, after landing and after stopping the engine).
Below I've include the code I got to so far. I haven't been able to calculate the time difference and to show that value automatically when the second value is available (e.g. block time = blocks on - blocks off; flight time = landing - takeoff).
I'd be grateful if anyone could help!
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<html xmlns="<head>
<meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type"/>
<meta name="viewport" content="width=device-width; initial-scale=1.4; maximum-scale=1.4; user-scalable=0;">
<meta name = "format-detection" content = "telephone=no">
<META NAME="Googlebot" CONTENT="noindex">
<title>TimeStamper</title>
<script type="text/javascript">
function BlocksOff(TimeStamp1) {
Time_Blocks_Off = new Date().toUTCString();
TimeStamp1.TimeBlocksOff.value = Time_Blocks_Off;
}
function TakeOff(TimeStamp2) {
Time_TakeOff = new Date().toUTCString();
TimeStamp2.TimeTakeOff.value = Time_TakeOff;
}
function Landing(TimeStamp3) {
Time_Landing = new Date().toUTCString();
TimeStamp3.TimeLanding.value = Time_Landing;
}
function BlocksOn(TimeStamp4) {
Time_Blocks_On = new Date().toUTCString();
TimeStamp4.TimeBlocksOn.value = Time_Blocks_On;
TimeResult1.BlockTime.value = ( Time_Blocks_Off - Time_Blocks_On );
}
--></SCRIPT>
<html>
<head>
<TITLE>TimeStamper</TITLE>
</head>
<body BGCOLOR="#FFFFFF">
<FORM NAME="TimeStamp1">
<TABLE>
<TR> <TD align="center"> <INPUT TYPE="TEL" style="text-align: center" NAME="TimeBlocksOff" SIZE="35"></TD>
<TD align="center"> <INPUT TYPE="BUTTON" NAME="Submit" VALUE="Blocks off" ONCLICK="BlocksOff(this.form)"> </TD> </TR>
</TABLE>
</FORM>
<br />
<FORM NAME="TimeStamp2">
<TABLE>
<TR> <TD align="center"> <INPUT TYPE="TEL" style="text-align: center" NAME="TimeTakeOff" SIZE="35"> </TD>
<TD align="center"> <INPUT TYPE="BUTTON" NAME="Submit" VALUE="Takeoff" ONCLICK="TakeOff(this.form)"> </TD> </TR>
</TABLE>
</FORM>
<br />
<FORM NAME="TimeStamp3">
<TABLE>
<TR> <TD align="center"> <INPUT TYPE="TEL" style="text-align: center" NAME="TimeLanding" SIZE="35"></TD>
<TD align="center"> <INPUT TYPE="BUTTON" NAME="Submit" VALUE="Landing" ONCLICK="Landing(this.form)"> </TD> </TR>
</TABLE>
</FORM>
<br />
<FORM NAME="TimeStamp4">
<TABLE>
<TR> <TD align="center"> <INPUT TYPE="TEL" style="text-align: center" NAME="TimeBlocksOn" SIZE="35"></TD>
<TD align="center"> <INPUT TYPE="BUTTON" NAME="Submit" VALUE="Blocks on" ONCLICK="BlocksOn(this.form)"> </TD> </TR>
</TABLE>
</FORM>
<br />
<FORM NAME="TimeResult1">
<TABLE>
<TR> <TD align="center"> <INPUT TYPE="BUTTON" NAME="Submit" VALUE="Block time" ONCLICK="BlockTime(this.form)"> </TD>
<TD align="center"> <INPUT TYPE="TEL" style="text-align: center" NAME="BlockTime" SIZE="35"></TD> </TR>
</TABLE>
</FORM>
<br />
<FORM NAME="TimeResult2">
<TABLE>
<TR> <TD align="center"> <INPUT TYPE="BUTTON" NAME="Submit" VALUE="Flight time" ONCLICK="BlockTime(this.form)"> </TD>
<TD align="center"> <INPUT TYPE="TEL" style="text-align: center" NAME="FlightTime" SIZE="35"></TD> </TR>
</TABLE>
</FORM>
</body>
</html>
I am new to this forum and have recently started to explore Javascript functionality to create little 'programs' to help me with my hobby as a private pilot.
One of the applications I have in mind simply makes a timestamp of different flight phases when the pilot presses the relevant button (before taxi, before takeoff, after landing and after stopping the engine).
Below I've include the code I got to so far. I haven't been able to calculate the time difference and to show that value automatically when the second value is available (e.g. block time = blocks on - blocks off; flight time = landing - takeoff).
I'd be grateful if anyone could help!
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<html xmlns="<head>
<meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type"/>
<meta name="viewport" content="width=device-width; initial-scale=1.4; maximum-scale=1.4; user-scalable=0;">
<meta name = "format-detection" content = "telephone=no">
<META NAME="Googlebot" CONTENT="noindex">
<title>TimeStamper</title>
<script type="text/javascript">
function BlocksOff(TimeStamp1) {
Time_Blocks_Off = new Date().toUTCString();
TimeStamp1.TimeBlocksOff.value = Time_Blocks_Off;
}
function TakeOff(TimeStamp2) {
Time_TakeOff = new Date().toUTCString();
TimeStamp2.TimeTakeOff.value = Time_TakeOff;
}
function Landing(TimeStamp3) {
Time_Landing = new Date().toUTCString();
TimeStamp3.TimeLanding.value = Time_Landing;
}
function BlocksOn(TimeStamp4) {
Time_Blocks_On = new Date().toUTCString();
TimeStamp4.TimeBlocksOn.value = Time_Blocks_On;
TimeResult1.BlockTime.value = ( Time_Blocks_Off - Time_Blocks_On );
}
--></SCRIPT>
<html>
<head>
<TITLE>TimeStamper</TITLE>
</head>
<body BGCOLOR="#FFFFFF">
<FORM NAME="TimeStamp1">
<TABLE>
<TR> <TD align="center"> <INPUT TYPE="TEL" style="text-align: center" NAME="TimeBlocksOff" SIZE="35"></TD>
<TD align="center"> <INPUT TYPE="BUTTON" NAME="Submit" VALUE="Blocks off" ONCLICK="BlocksOff(this.form)"> </TD> </TR>
</TABLE>
</FORM>
<br />
<FORM NAME="TimeStamp2">
<TABLE>
<TR> <TD align="center"> <INPUT TYPE="TEL" style="text-align: center" NAME="TimeTakeOff" SIZE="35"> </TD>
<TD align="center"> <INPUT TYPE="BUTTON" NAME="Submit" VALUE="Takeoff" ONCLICK="TakeOff(this.form)"> </TD> </TR>
</TABLE>
</FORM>
<br />
<FORM NAME="TimeStamp3">
<TABLE>
<TR> <TD align="center"> <INPUT TYPE="TEL" style="text-align: center" NAME="TimeLanding" SIZE="35"></TD>
<TD align="center"> <INPUT TYPE="BUTTON" NAME="Submit" VALUE="Landing" ONCLICK="Landing(this.form)"> </TD> </TR>
</TABLE>
</FORM>
<br />
<FORM NAME="TimeStamp4">
<TABLE>
<TR> <TD align="center"> <INPUT TYPE="TEL" style="text-align: center" NAME="TimeBlocksOn" SIZE="35"></TD>
<TD align="center"> <INPUT TYPE="BUTTON" NAME="Submit" VALUE="Blocks on" ONCLICK="BlocksOn(this.form)"> </TD> </TR>
</TABLE>
</FORM>
<br />
<FORM NAME="TimeResult1">
<TABLE>
<TR> <TD align="center"> <INPUT TYPE="BUTTON" NAME="Submit" VALUE="Block time" ONCLICK="BlockTime(this.form)"> </TD>
<TD align="center"> <INPUT TYPE="TEL" style="text-align: center" NAME="BlockTime" SIZE="35"></TD> </TR>
</TABLE>
</FORM>
<br />
<FORM NAME="TimeResult2">
<TABLE>
<TR> <TD align="center"> <INPUT TYPE="BUTTON" NAME="Submit" VALUE="Flight time" ONCLICK="BlockTime(this.form)"> </TD>
<TD align="center"> <INPUT TYPE="TEL" style="text-align: center" NAME="FlightTime" SIZE="35"></TD> </TR>
</TABLE>
</FORM>
</body>
</html>