HELP!!!

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



<HTML>
<Head> <CENTER>MATHEMATICAL OPERATION </HEAD>
<CENTER>

<FORM NAME="number">
Number 1<INPUT TYPE="text" Value="" NAME="num1">
<BR>
Number 2<INPUT TYPE="text" Value="" NAME="num2">

</FORM>
//THIS IS THE ERROR!! 
//THE RESULT SHUD NOT HAVE A TEXTBOX..
// THE NUMBER 1 AND NUMBER TWO VALUE SHUD NOT BE ERASED WHEN IT WILL BE ADD/ SUBTRATCT OR MULTIPLY..

<FORM NAME="number2">
RESULT <INPUT TYPE="text" Value="0" NAME="numb4">
</FORM>
</HEAD>
<body>
<SCRIPT><!--
function go(){
document.number.num1.value = ("0");
document.number2.numb4.value = ("");
}

var numb1 = document.number.num1.value
var numb2 = document.number.num2.value


function add(){
document.number2.numb4.value = parseInt(document.number.num1.value) + parseInt(document.number.num2.value);
document.number.num1.value = ("");
document.number.num2.value = ("");
}

function mult(){
document.number2.numb4.value = (document.number.num1.value * document.number.num2.value);
document.number.num1.value = ("");
document.number.num2.value = ("");
}

function sub(){
document.number2.numb4.value = (document.number.num1.value - document.number.num2.value);
document.number.num1.value = ("");
document.number.num2.value = ("");
}

</SCRIPT>

<FORM NAME="MyForm">
<INPUT TYPE="button" NAME="none" Value=" ADD " OnClick="add()">
<INPUT TYPE="button" NAME="none5" Value=" SUBTRACT " OnClick="sub()">
<INPUT TYPE="button" NAME="none3" Value=" MULTIPLY " OnClick="mult()">


</FORM>
</CENTER>
</body> 


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux