David Shadovitz
Mon, 27 Nov 2000 23:19:44 -0800
Your select options probably look like this:
<option
value="#qProducts.ProductName#">#qProducts.ProductName#</option>
If your action page doesn't need to know the product names, only the
prices, replace the option's value with the price:
<option value="#qProducts.Cost#">#qProducts.ProductName#</option>
If the action page needs both the name and the price, pass both as the
value:
<option
value="#qProducts.ProductName#,#qProducts.Cost#">#qProducts.ProductName#<
/option>
The action page will get a two-element list. Use
ListFirst(Form.mySelect) and ListLast(Form.mySelect) to get the product
name and price, resp.
-David
On Tue, 28 Nov 2000 00:06:30 -0500 "Adrienne H. Cregar"
<[EMAIL PROTECTED]> writes:
> Hello all... Hope you can help. I'm new to CF and can't seem to
> figure
> this out - should be obvious but it's not. I have 4 tables within a
> database, each of which have an id#, product name and cost (like
> this):
>
> Table A fields: IDA, ProductA, CostA
> Table B fields: IDB, ProductB, CostB
> Table C fields: IDC, ProductC, CostC
> Table D fields: IDD, ProductD, CostD
>
> I have a form where there are 4 select fields populated by the
> product
> names within each table. What I want to do is to identify the cost
> (the
> value for the cost field in that record) for that product based on
> the
> product selected, so that I can perform some calculations based on
> it.
> In other words, if Product A is selected from the form, I want to
> get
> Product A's price and pass it to the results page, where I will then
> perform calculations based on that cost. How do I identify the cost
> value based on the product name selected? How do I pass that along?
> I
> tried using a hidden field to pass the value, but it listed the
> costs
> for each record - not the one selected. Right now, my results page
> just
> posts the choices that the user selects... that is working fine.
> Can't
> figure out how to get the cost identified and moved over there...
> Any
> help you can offer would be greatly appreciated.
> Thank you in advance!
________________________________________________________________
GET INTERNET ACCESS FROM JUNO!
Juno offers FREE or PREMIUM Internet access for less!
Join Juno today! For your FREE software, visit:
http://dl.www.juno.com/get/tagj.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists