• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Lesson 9. Completing the Price Calculato... > Dynamically Populated Drop-Down Menu...

Dynamically Populated Drop-Down Menus

As you'll recall from Lesson 7, when the user submits the form on tourprice.asp, three pieces of data are sent: number of adults, number of children, and a dummy value for the cost of the tour. The ASP or ColdFusion script on tourprice_processor then multiplies the number of adults by the dummy tour price and multiplies the number of children by the dummy tour price, adds the two results together, and outputs the number in HTML.

To replace the dummy values with real data takes a little work. To begin, you need to populate the drop-down menu in the form with real data. As you know, the drop-down menu can send only one piece of data, but you need to access two: the price for adults and the price for children. Therefore, rather than sending a dollar value, you'll send a unique identifier for the tour. On tourprice_processor.asp, you'll use that unique identifier to query the database for the adult price and child price for just that tour. You'll insert these values into the calculation, outputting the correct final value.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint