PDA

View Full Version : 2 Values for combo boxes



Frogger
04-21-2006, 02:02 AM
Hi,

Is it possible to be able to have 2 values associated with a combo box ?

See example below:

<select name="basket" onClick="compute(this.form)">
<option value="">- Qty -</option>
<option value="40">Roses</option>
<option value="50">tulips</option>
<option value="60">plant</option>
<option value="70">bunch</option>
</select>

So what I am trying to do is that when you submit the form it sends out an email. But the result from the email for example will say:

basket: 60 (if you choose plants - 60 been the dollar value which i need for further calculations in the form)

Is there any way that you can have the text ie. Roses, tulips, etc sent along with the value (40, 50 etc) when you submit the form ?

So something like: basket: plant, 60 appears

I hope this makes sence.

Regards
Frogger:confused:

djr33
04-21-2006, 03:02 AM
Not a JS question.

You need to look into coding your own form interpretation page with PHP.

Or look into a better form interpreter if you're using a free one.

However, you can't get the value you have unless it's the "name" or "value" item.
So.... you could make it value="60" name="plant"... that would do something.


But... seriously, why can't you just make it "60, plant" as the VALUE?

Ex:
value="60, plant"

That's the really easy answer. Hope it works.