need help with a script

  • Thread starter Thread starter thank you
  • Start date Start date
T

thank you

below is a script i have made up and i can not seem to get the number to add
up, it is the last line, for.total...... that i think is not right, it
should add the numbers together, not add then as a string.

thank you in advance for your help.




<script language="JavaScript"><!--
function Morgcal()
{
form = document.myform
sum1= form.num1.value
sum2= form.num2.value
sum3= form.num3.value
sum4= form.num4.value

sum=0

ctotal=(sum1)
ctotal=ctotal+(sum2)
ctotal=ctotal+(sum3)
ctotal=ctotal+(sum4)

form.total.value=Math.floor(ctotal)
}
// --></script>
 
thank said:
below is a script i have made up and i can not seem to get the number
to add up, it is the last line, for.total...... that i think is not
right, it should add the numbers together, not add then as a string.

thank you in advance for your help.




<script language="JavaScript"><!--
function Morgcal()
{
form = document.myform
sum1= form.num1.value
sum2= form.num2.value
sum3= form.num3.value
sum4= form.num4.value

sum=0

ctotal=(sum1)
ctotal=ctotal+(sum2)
ctotal=ctotal+(sum3)
ctotal=ctotal+(sum4)

form.total.value=Math.floor(ctotal)
}
// --></script>

You'll get a lot faster answer by posting in one of the many newsgroups that
are focused on this type of question. Display the newsgroups list and type
"script" to see these groups.

--
Ronnie Vernon
Microsoft MVP
Windows Shell/User

Please reply to the newsgroup so all may benefit.
http://www.dts-l.org
http://www.mvps.org
 
Back
Top