P
patrick_woflian
hey guys, im just writing a basic calculation at the moment, before
building on it for an A-Level piece of work. i can add/divide etc...
two numbers together yet i am having a major problem with the following
calculation:
z = x! / (x- y)!
The following code is my attempt and i was hoping for a point in the
right direction as too where i am going wrong.. cheers
<html>
<head>
<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 = "Calculate" onClick =
calculate()>
</FORM>
<script language = "javascript">
function calculate() {
A = document.frmOne.txtFirstNumber.value
B = document.frmOne.txtSecondNumber.value
C = (A ! / (A - B ) ! )
document.frmOne.txtThirdNumber.value = C
}
</script>
</head>
<body> Refresh to run the script again
</body>
Patrick
building on it for an A-Level piece of work. i can add/divide etc...
two numbers together yet i am having a major problem with the following
calculation:
z = x! / (x- y)!
The following code is my attempt and i was hoping for a point in the
right direction as too where i am going wrong.. cheers
<html>
<head>
<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 = "Calculate" onClick =
calculate()>
</FORM>
<script language = "javascript">
function calculate() {
A = document.frmOne.txtFirstNumber.value
B = document.frmOne.txtSecondNumber.value
C = (A ! / (A - B ) ! )
document.frmOne.txtThirdNumber.value = C
}
</script>
</head>
<body> Refresh to run the script again
</body>
Patrick