Skip to content

Instantly share code, notes, and snippets.

@wallace
Created July 17, 2009 15:11
Show Gist options
  • Select an option

  • Save wallace/149098 to your computer and use it in GitHub Desktop.

Select an option

Save wallace/149098 to your computer and use it in GitHub Desktop.
<script language="JavaScript">
function Calculate(form){
roof_area=parseFloat(form.roof_area.value);
total_rainfall=parseFloat(form.total_rainfall.value);
percentage=parseFloat(form.percentage.value);
total_gallons=roof_area*total_rainfall*(percentage/100)*0.623;
form.output.value=total_gallons;
form.output.value+=" gallons collected annually";
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment