Hello All,
I’m doing an assignment to make input boxes where I can perform different functions like adding, subtracting, multiplying, dividing, modulus, and isEven.
Here is the javascript I wrote for addition:
<SCRIPT language = JavaScript>
function calculate() {
A = document.frmOne.txtFirstNumber.value
B = document.frmOne.txtSecondNumber.value
A = Number(A)
B = Number(?
C = (A + ?
document.frmOne.txtThirdNumber.value = C
}
</script>
and in the html:
<FORM NAME = frmOne>
Number One:
<INPUT TYPE = Text NAME = txtFirstNumber SIZE = 5 value =””>
Number Two:
<INPUT TYPE = Text NAME = txtSecondNumber SIZE = 5 value =””>
<P> Total:
<INPUT TYPE = Text NAME = txtThirdNumber SIZE = 5 value = “”>
<P>
<Input Type = Button NAME = b1 VALUE = “Add Numbers” onClick = calculate()>
</FORM>
If anyone can point me in the right direction, I would appreciate it.:rolleyes: I think I’m not understanding the similar code in the function javascript and the html code to activate the function. Any help/advice would be great?
Thanks
?