Why I have problem in results and function doesn't working in java script. even codes are exect.

<HTML>
<HEAD><Title>Basic Calculator</Title>
</HEAD>
<script language="JavaScript">
<!--
function Addit()
{
var num1=document.Calform.One.value; var

num2=document.Calform.Two.value;
document.Calform.result.value=parseFloat(num1)+parseFloat(num2);
//alert(parseFloat(num1)+parseFloat(num2));

}
function minus()
{ var num1=document.Calform.One.value; var

num2=document.Calform.Two.value;
document.Calform.result.value=parseFloat(num1)-parseFloat(num2);

//alert(parseFloat(num1)-parseFloat(num2));
}
function Multiplyit()
{
var num1=document.Calform.One.value; var

num2=document.Calform.Two.value;
document.Calform.result.value=parseFloat(num1)-parseFloat(num2);//alert

(parseFloat(num1)*parseFloat(num2));
}
function Divideit()
{ var num1=document.Calform.One.value; var

num2=document.Calform.Two.value;
document.Calform.result.value=parseFloat(num2)/parseFloat(num1);

//alert(parseFloat(num2)/parseFloat(num1));
} //-->
</script>
<FORM name="Calform">
<TABLE>
<B>
<TABLE border=2 width=50 height=60 cellpadding=1 cellspacing=5>
<TR>
<TD>
FirstValue</TD>
<TD colspan=5><INPUT TYPE="TEXT" NAME="One" mxlength="15">
</TD>
</TR>
<TR>
<TD>
SecondValue</TD>
<TD colspan=5><INPUT TYPE="TEXT" NAME="Two" maxlength="15"></TD>
</TR>
<TR>
<TD>
ResultValue</TD>
<TD colspan=5><INPUT TYPE="TEXT" NAME="result" mxlength="15" Disabled>
</TD>
</TR>
<TR>
<TD>
</TD>
<TD>
<INPUT TYPE="BUTTON" NAME="ADD" VALUE="Addition"

onclick="addit()"><INPUT TYPE="BUTTON" NAME="MINUS" VALUE="Subtraction"

onclick="minus()">
<INPUT TYPE="BUTTON" NAME="MULTIPLY" VALUE="Mutipliction"

onclick="multiplyit()"><INPUT TYPE="BUTTON" NAME="DIVIDE"

VALUE="Division" onclick="divideit()">
<INPUT TYPE="BUTTON" NAME="REMAINDER" VALUE="Remainder"><INPUT

TYPE="RESET" NAME="RESET" VALUE="Clear">
</TD>
</TR>
</TABLE>
</FORM>
</BODY>
</HTML>

aminah87
Asked May 19, 2010

TIP: If it's not your answer to this question, please click "Leave a Comment" button under the question to communicate with the question owner.

Categories