var score = 0; $(document).ready(function(){ $('#Trophybutton').click(function() { ClaimTrophy(this.form); }); }); function checkAnswers(form) { score = 0; if (score < ) { document.getElementById("Checkbuttontext").value ="Check again"; } if (score >= ) { document.getElementById("Trophybutton").style.visibility ="visible"; document.getElementById("Trophybutton").value ="Claim Your Trophy for " + score + " out of "; } if (score == ) { document.getElementById("Checkbutton").style.visibility ="hidden"; //document.getElementById("Trophybutton").style.marginTop="-200px"; } } function ClaimTrophy(form) { form.Other_Text.value = score + ' out of '; form.submit(); } function ShowDescription() { document.getElementById("GreyOut").style.visibility ="visible"; document.getElementById("DescriptionBox").style.visibility ="visible"; } function HideDescription() { document.getElementById("GreyOut").style.visibility ="hidden"; document.getElementById("DescriptionBox").style.visibility ="hidden"; } function ShowHelp() { document.getElementById("GreyOut").style.visibility ="visible"; document.getElementById("HelpBox").style.visibility ="visible"; } function HideHelp() { document.getElementById("GreyOut").style.visibility ="hidden"; document.getElementById("HelpBox").style.visibility ="hidden"; } function RemoveSpaces(){ var StudentsText; for (var z=1; z<=; z++ ){ StudentsText = $('input[name=Guess'+z+']').val().split(' ').join(''); StudentsText = StudentsText.replace(//g,''); $('input[name=Guess'+z+']').val(StudentsText); } }