Web Hosting Talk







View Full Version : Help with a form....


freew
01-24-2003, 04:45 PM
Here is what I want to do...

I have a form with a drop down box with three options:
Product A
Product B
Product C

A costs $3 to buy
B costs $5
C costs $7

When they choose B in the drop down box, the "Cost" varaible in the form automatically goes to $5, if they pick "c" it goes to $7


Anyone know how to do that ??

Akash
01-24-2003, 05:18 PM
Maybe use javascript? Are you trying to update the prices in real time? if not then you could use PHP....

DeX
01-28-2003, 07:24 PM
<FORM action="process.php">
<SELECT name="Cost">
<OPTION value="$3">Product A ($3)
<OPTION value="$5">Product A ($5)
<OPTION value="$7">Product A ($7)
</SELECT>
</FORM

than in PHP you will have $Cost variable defined with $3,$5 or $7

hope this helps

-DeX