We help IT Professionals succeed at work.

# How to calculate 3 textbox multiply values in real time?

on
2,110 Views
I have aspx page which has 4 textbox.

txtAmount, txtExchangeRate, txtCharges, txtResult

When you input txtAmount, txtExchangeRate, txtCharges, then txtResult will show the calculated result.

e.g. 405 * 0.88 + 20 = result

As there are many rows in that listInput, how can it be done to show the result in real time?
Comment
Watch Question

## View Solutions Only

IT Expert
CERTIFIED EXPERT
Top Expert 2009

Commented:
With straight JS I would do this - I hope this is NOT homework - it is it, next time please start the html and script yourself and ask if you are stuck:

``````<html>
<title></title>
<script type="text/javascript">
function calc(theForm) {
var amount = parseFloat(theForm.txtAmount.value)
if (isNaN(amount)) amount=0;
var exchangeRate = parseFloat(theForm.txtExchangeRate.value)
if (isNaN(exchangeRate)) exchangeRate=0;
var charges = parseFloat(theForm.txtCharges.value)
if (isNaN(charges)) charges=0;
var result =  (amount * exchangeRate) + charges
theForm.txtResults.value=result.toFixed(2);
}
</script>
<body>
<form>
<input type="text" name="txtAmount"       value="" onKeyUp="calc(this.form)" /> *
<input type="text" name="txtExchangeRate" value="" onKeyUp="calc(this.form)" /> +
<input type="text" name="txtCharges"      value="" onKeyUp="calc(this.form)" /> =
</form>
</body>
</html>
``````
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
IT Expert
CERTIFIED EXPERT
Top Expert 2009
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
IT Expert
CERTIFIED EXPERT
Top Expert 2009

Commented:
erm 50 points, split and then an uncommented "B" grade???

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

###### Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

Deciding to stick with EE.

Mohamed Asif

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
###### Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Connect with Certified Experts to gain insight and support on specific technology challenges including:

• Troubleshooting
• Research
• Professional Opinions
Unlock the solution to this question.

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

OR

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the