Help


#1

I don't know how to get my button to calculate. Please help.

<HTML>
		<HEAD>
		<TITLE>Get Your Grade</TITLE>
		</HEAD>
		<BODY> 
			<h1>Calculate Your Cyber Grade</h1><br>
			<FORM name="b" onsubmit="return false;">
				<h2>Homework Average:</h2><br><INPUT type="number" name="hw" value=""><br>
				<h2>Lab Average:</h2><br><INPUT type="number" name="lab" value=""><br>
				<h2>Six Weeks Exam:</h2><br><INPUT type="number" name="six" value=""><br>
				<h2>Twelve Weeks Exam:</h2><br><INPUT type="number" name="twelve" value=""><br>
				<h2>Final Exam:</h2><br><INPUT type="number" name="final" value=""><br>
				<h2>Instructor Option:</h2><INPUT type="number" name="inst" value=""><br>
				<br><br><h2>Final Grade:</h2><INPUT type="number" name="c" value="a">
				<INPUT type="button" value="Get That Grade!"
					onclick="var a = document.forms.b.c.value;
					document.forms.b.c.value = (document.forms.b.hw.value * .15+document.forms.b.lab.value* .15+document.forms.b.six.value * .15+document.forms.b.twelve.value * .15+document.forms.b.final.value * .3+document.forms.inst.value * .1) / 6;">
				
			</FORM>
							
		
		</BODY>
		</HTML>

#2

Please re-edit your Post

  • select your code in the Post
  • then =click= on the </>-symbol-of-this-editor

Your code will then be in a pre-code state
and you will be able to make/present the proper indentations.


#3

Okay. I did that. Thank you.


#5

I don't exactly understand what you posted. Could you explain a little bit more please?


#6

i deleted the post, i couldn't figure it out. Anyway, you wrote javascript code in html without any script tags, that is never going to work


#8

Did you figure out a way to fix my code?