Cricket Batting Bowling Average Calculator

Cricket Average Calculator script that helps you to calculate the amount of runs, number of times dismissed and the amount of wickets taken.

Features

  • Simple and efficient calculator for calculating the cricket average.
  • Good tool for the cricket players to calculate their runs, wickets takes and times dismissed.
  • Just copy the code into your page and use it.

Preview


Cricket Average Calculator
Batting Average
Runs :
Times Dismissed :
Average :
  
Bowling Average

Wickets :
Runs Hit Against You :
Average :
  
©h

Simply fill in any two of the three text fields in either the Batting or Bowling average forms. Make sure at least one of the three text fields are empty.

Downloads

Javascript


<!-- Script by hscripts.com -->

<script type="text/JavaScript">
function batave()
{if(!document.form.ave1.value == "" &&
!document.form.runs1.value == "" && !document.form.dis1.value == "" )
{
alert("Enter only two fields and leave the third one empty");
}
else{
if (document.form.ave1.value == "")
document.form.ave1.value = document.form.runs1.value/document.form.dis1.value
if (document.form.runs1.value == "")
document.form.runs1.value = document.form.ave1.value*document.form.dis1.value
if (document.form.dis1.value == "")
document.form.dis1.value = document.form.runs1.value/document.form.ave1.value}
}
function bowlave()
{if(!document.form.ave2.value == "" && !document.form.hit1.value == "" && !document.form.wick1.value == "" )
{
alert("Enter only two fields and leave the third one empty");
}else
{
if (document.form.ave2.value == "")
document.form.ave2.value = document.form.hit1.value/document.form.wick1.value
if (document.form.hit1.value == "")
document.form.hit1.value = document.form.ave2.value*document.form.wick1.value
if (document.form.wick1.value == "")
document.form.wick1.value = document.form.hit1.value*document.form.ave2.value
}
}
function clearbat() {
document.form.ave1.value = ""
document.form.runs1.value = ""
document.form.dis1.value = ""
}
function clearbowl() {
document.form.ave2.value = ""
document.form.wick1.value = ""
document.form.hit1.value = ""
}
function isNumberKey(evt){var charCode = (evt.which) ? evt.which : event.keyCodeif (charCode > 31 && (charCode < 48 || charCode > 57)){alert("Enter only numbers");return false;}return true;}
function ctck()
{
var sds = document.getElementById("dum");
if(sds == null){alert("You are using a free package.\n You are not allowed to remove the tag.\n");}
var sdss = document.getElementById("dumdiv");
if(sdss == null){alert("You are using a free package.\n You are not allowed to remove the tag.\n");}
}
document.onLoad=ctck();
</script>

<!-- Script by hscripts.com -->




HTML Code


<body">
<form name="form">
<p align="center"><font size="6" color="green">Cricket Average Calculator</font><br>
</p>
<table border="1" cellpadding="1" width="100%"><tr><td width="50%" height="333">
<h2><font color="blue">Batting Average</font></h2>
<h3>Runs : <input type="text" name="runs1" size="20" onkeypress="return isNumberKey(event)"></h3><p><br></p>
<h3>Times Dismissed : <input type="text" name="dis1" size="20" onkeypress="return isNumberKey(event)"></h3><p><br></p>
<h3>Average : <input type="text" name="ave1" value="" size="20" onkeypress="return isNumberKey(event)"></h3><p>
<input type="button" value="Compute" OnClick="batave()">
<input type="button" value="Clear" OnClick="clearbat()"> </p><p> </td><td width="50%" height="333" >
<h2><font color="blue">Bowling Average</font></h2>
<h3>Wickets : <input type="text" name="wick1" size="20" onkeypress="return isNumberKey(event)"></h3><p><br></p>
<h3>Runs Hit Against You : <input type="text" name="hit1" size="20" onkeypress="return isNumberKey(event)"></h3><p><br></p>
<h3>Average : <input type="text" name="ave2" value="" size="20" onkeypress="return isNumberKey(event)"></h3><br>
<input type="button" value="Compute" OnClick="bowlave()">
<input type="button" value="Clear" OnClick="clearbowl()"></p></td></tr>
</table>
</form>

  • Release Date - 06-05-2010
  • Get free version without ©copyright link for just $10/-
  • For customization of this script or any script development, mail to support@hscripts.com

Usage

  • Copy and paste the Html code into the <body> tag.
  • Then Copy the javascript code into <head> tag of your page.
  • The two important functions are "batave()" and "bowlave()" which is used to calculate the batting and bowling average respectively.
  • Make use of this script and calculate your life time cricket achievements.

License

Related Scripts

Free Javascript Scripts


Ask Questions

Ask Question