Multiply from text boxes ab*ab I need result ab*a displayed and after ab*ab

Posted by Shivu under C# on 4/18/2012 | Points: 10 | Views : 3515 | Status : [Member] | Replies : 6
I need result immediately, I need to multiply two numbers from the text boxes.
e.g., I need to multiply 99 and 99. I'll enter 99 in one text box , while entering another text box I need 99*9 value after 99*99.




Responses

Posted by: Sakthi.Singaravel on: 4/18/2012 [Member] Silver | Points: 25

Up
0
Down
i can't understand ur expection..

can u explain..?

Regards,
Singaravel M

Shivu, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Shivu on: 4/18/2012 [Member] Starter | Points: 25

Up
0
Down
First I need to check both the text boxes are not empty. Now you need to multiply 2*1000 ; for that you enter 2 in either of the text boxes and you start to enter 1000 in another text box for that you first enter 1, as soon as you enter 1 I need to display result 2 (2*1), after you enter 0 now I need result as 20 (2*10), 200 (2*100) and finally (2*1000)

Shivu, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sakthi.Singaravel on: 4/18/2012 [Member] Silver | Points: 25

Up
0
Down
okay i understand just wait..

Regards,
Singaravel M

Shivu, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: dhirenkaunar-15094 on: 4/18/2012 [Member] Starter | Points: 25

Up
0
Down
Hi Shivu,

I think the below is the code which you will looking for .

This will multiply the 2nd text box value on change what you expecting.
<head>

<title>Untitled Page</title>
<script type="text/javascript">
function Multiply() {

var inp1 = document.getElementById("txt1").value;
var inp2 = document.getElementById("Text2").value;

var imp2 = inp2 * inp1;
document.getElementById("Text3").value = imp2;

}
</script>
</head>
<body>
Text Box 1 <input type="text" id="txt1" />
Text Box 2 <input type="text" id="Text2" onkeyup="Multiply()"/>
Text Box 1 <input type="text" id="Text3" />
</body>
</html>


Please mark as answer if it satisfy your need.

Thanks & Rgards,
Dhiren Kumar Kaunar

Shivu, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sakthi.Singaravel on: 4/18/2012 [Member] Silver | Points: 25

Up
0
Down
Hi,

Code is..

private void textBox2_TextChanged(object sender, EventArgs e)

{
int a = int.Parse(textBox1.Text);
int b = int.Parse(textBox2.Text);
int result = a * b;
textBox3.Text = result.ToString() ;
}


Regards,
Singaravel M

Shivu, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sakthi.Singaravel on: 4/18/2012 [Member] Silver | Points: 25

Up
0
Down
Hi Shivamurthy,

r u got ur expected solution...?

Regards,
Singaravel M

Shivu, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response