»
EnglishFrenchVietnamese

Print - Simple Hockey Scoreboard - JavaScriptBank.com

Full version: jsB@nk » Utility » Simple Hockey Scoreboard
URL: https://www.javascriptbank.com/simple-hockey-scoreboard.html

Simple Hockey Scoreboard © JavaScriptBank.comHere is a simple scoreboard intended for hockey but it can be used for other sports too. There is a fully ajustible clock and home and away team score displays.

Full version: jsB@nk » Utility » Simple Hockey Scoreboard
URL: https://www.javascriptbank.com/simple-hockey-scoreboard.html



JavaScript
<SCRIPT language=JavaScript>var homename = prompt ('type home team name below',' ');var awayname = prompt ('type away team name below',' ');var keepgoing=falsevar up,down;var min1,sec1;var cmin1,csec1,cmin2,csec2;function Minutes(data) {for(var i=0;i<data.length;i++)if(data.substring(i,i+1)==":")break;  return(data.substring(0,i));}function Seconds(data) {for(var i=0;i<data.length;i++)if(data.substring(i,i+1)==":")break;return(data.substring(i+1,data.length));}function Display(min,sec) {var disp;if(min<=9) disp=" 0";else disp=" ";disp+=min+":";if(sec<=9) disp+="0"+sec;else disp+=sec; return(disp); }function Down() {cmin2=1*Minutes(document.scoreboard.beg2.value);csec2=0+Seconds(document.scoreboard.beg2.value);DownRepeat(); }function DownRepeat() {csec2--;if(csec2==-1) {csec2=59; cmin2--;}document.scoreboard.disp2.value=Display(cmin2,csec2);if((cmin2==0)&&(csec2==0))alert("Countdown Stopped");else down=setTimeout("DownRepeat()",1000);}// End --></SCRIPT><SCRIPT language=javascript>function scored() {document.scoreboard.homescore.value += '+1';}function doit() {var userinput = document.scoreboard.homescore.value;document.scoreboard.homescore.value = eval (userinput);}function deduct() {document.scoreboard.homescore.value += '-1';}function scored2() {document.scoreboard.awayscore.value += '+1';}function doit2() {var userinput = document.scoreboard.awayscore.value;document.scoreboard.awayscore.value = eval (userinput);}function deduct2() {document.scoreboard.awayscore.value += '-1';}function stop() {alert("Timer has stopped; push OK to resume")}function teamnames() {document.scoreboard.homename.value = homename;document.scoreboard.awayname.value = awayname;}function teamnames2() {document.scoreboard.marquee.value= 'homename' + 'vs' + 'awayname';}</SCRIPT><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<BODY bgColor=#000000 onload=teamnames() text=white><FORM name=scoreboard action=--WEBBOT-SELF-- method=POST><TABLE borderColor=#000000 height=86 width="100%" border=5>  <TBODY>  <TR>    <TD borderColor=#000000 align=middle width="100%" bgColor=#8196ba colSpan=4     height=30>Start at <INPUT size=7 value=20:00 name=beg2> <INPUT size=7       name=disp2> <INPUT onclick=Down() type=button value=Start> <INPUT onclick=stop() type=button value=Stop></TD></TR>  <TR>    <TD borderColor=#000000 align=middle width="34%" bgColor=#8196ba       height=22><B><FONT face="Abadi MT Condensed Extra Bold">Period 1</FONT></B> <INPUT type=radio CHECKED value=V3 name=R1></TD>    <TD borderColor=#000000 align=middle width="33%" bgColor=#8196ba colSpan=2     height=22><B><FONT face="Abadi MT Condensed Extra Bold">Period 2</FONT></B> <INPUT type=radio value=V1 name=R1></TD>    <TD borderColor=#000000 align=middle width="33%" bgColor=#8196ba       height=22><B><FONT face="Abadi MT Condensed Extra Bold">Period 3</FONT></B> <INPUT type=radio value=V2 name=R1></TD></TR>  <TR>    <TD borderColor=#000000 align=middle width="50%" bgColor=#ffdb48 colSpan=2     height=19>      <P align=center><INPUT value="type home team here" name=homename       display="homename"> <INPUT size=2 value=0 name=homescore></P></TD>    <TD borderColor=#000000 align=middle width="50%" bgColor=#ffdb48 colSpan=2     height=19>      <P align=center><INPUT size=2 value=0 name=awayscore><INPUT       value="type away name here" name=awayname></P></TD></TR>  <TR>    <TD borderColor=#000000 align=middle width="50%" bgColor=#ffdb48 colSpan=2     height=19><INPUT onclick="scored(); doit(); stop()" type=button value=Scored name=B1><INPUT onclick=deduct();doit();stop() type=button value=Deduct name=B2></TD>    <TD borderColor=#000000 align=middle width="50%" bgColor=#ffdb48 colSpan=2     height=19><INPUT onclick=scored2();doit2();stop() type=button value=Scored name=B3><INPUT onclick="deduct2();doit2(); stop()" type=button value=Deduct name=B4></TD></TR></TBODY></TABLE></FORM></body><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->