Skip to main content
Inspiring
February 12, 2008
Answered

add prices and display in dynamic text box

  • February 12, 2008
  • 3 replies
  • 344 views
Hey,

I have a combobox and radio buttons with specific prices that I want attached depending on the choice the user makes. I'm having trouble getting the application to add the total of the selections and display the total in a dynamic textbox.

I am trying to use global variables. I set them to a certain value depending on what is selected. At the end I set add them up in the variable total and set that equal to the text box named totalPrice.

Right now the value of the global variables is not being returned from their functions.

Any suggestions for how to do this correctly?

Thanks!
This topic has been closed for replies.
Correct answer kglad
remove those return statements, create a function that updates your totalPrice textfield and call that function from objComboListener.change after your if-else statements.

3 replies

kglad
Community Expert
Community Expert
February 13, 2008
you're welcome.
kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
February 12, 2008
remove those return statements, create a function that updates your totalPrice textfield and call that function from objComboListener.change after your if-else statements.
jay0316Author
Inspiring
February 12, 2008
Thanks So Much! It works great!

To anyone interested, here is the code that worked.
kglad
Community Expert
Community Expert
February 12, 2008
i'm not sure where you think that return statement is returning that value, but that's not going to do anything worthwhile. and i don't see where you're updating total after there's a change in one of the summands.
jay0316Author
Inspiring
February 12, 2008
kglad,

Thanks for your quick response. I know that the return doesn't work and that is why I decided to post it. Your suggestion about updating "total" was something I hadn't thought of. Can you give me anymore in terms of how to get the values out of the function and update "total"?

Thanks!

Oh, if anyone needs a link to the fla... fla file in zip format