# Ordering products

**URL:** <https://forum.kirupa.com/t/ordering-products/74473>\
**Category:** Uncategorized\
**Created:** [December 29, 2004, 3:29pm UTC](https://forum.kirupa.com/t/ordering-products/74473 "2004-12-29T15:29:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![malice](https://avatars.discourse-cdn.com/v4/letter/m/278dde/32.png) [@malice](https://forum.kirupa.com/u/malice)\
**Post date:** [December 29, 2004, 3:29pm UTC](https://forum.kirupa.com/t/ordering-products/74473/1 "2004-12-29T15:29:40Z")

</div>

hello,  
im trying to make a little application that lets users select a certain  
quantity of several products and then calculates the total cost  
so i have 2 columns each time the quantity and price of the product  
when i click the calculate button i needs to multiply the qty with the price  
for each product and then add the total prices for each product  
however i always get NaN in the dynamic textfield when i click the calculate button  
the code:

```auto
 
var esoplayer = 300;
var sony = 425;
var iriver = 195;
var philipscd = 168;
//de intitiële waarden (0) worden gedefinieerd voor qty1, qty2,..
qty1_txt.text = 0;
qty2_txt.text = 0;
qty3_txt.text = 0;
 
var listener:Object = new Object();
listener.click;
listener.click = function() {
total_txt.text = (Number(esoplayer)*Number(qty1_txt.text))+
(Number(sony)*Number(qty2_txt.text))+
(Number(iriver)*Number(qty3_txt.text))+
(Number(philipscd)*Number(qty4_txt.text));
};
calculate.addEventListener("click", listener);

```
