Two combo boxes in a form to equal one description?

C

Charles B. Summers

I need to take the values of two select boxes and have the results submitted
in a value named "ItemDesc". Is this possible? Our Merchant Account's built
in shopping cart only allows one Item Description per line, so what I need
to do is to combine the two selects to append to each other as "ItemDesc"

Here my code so far.

<form method="post"
action="http://www.eProcessingNetwork.Com/carts/AddToCart.pl">
Qty:
<input type="text" size="3" name="ItemQty" value="0">
<SELECT name="ItemDesc">
<option value="0" selected>Select</option>
<option value="019-103-MK">White Shiner</option>
<option value="019-107-MK">Silver Shiner</option>
<option value="019-115-MK">Baby Bass</option>
<option value="019-125-MK">Chartreuse w/Blue Back</option>
<option value="019-202-MK">Golden Shadow</option>
<option value="019-208-MK">Chartreuse Shiner</option>
<option value="019-210-MK">Chartreuse &amp; White</option>
<option value="019-214-MK">Firetiger</option>
</SELECT>
<select name="Item Desc">
<option value="Double Colorado">Double Colorado</option>
<option value="Double Willowleaf">Double Willowleaf</option>
<option value="Tandem Willowleaf">Tandem Willowleaf</option>
<option value="Tandem Indiana">Tandem Indiana</option>
<option value="Tandem Turtleback">Tandem Turtleback</option>
</select>
<input type="hidden" name="ItemCost" value="10.99">
<input type="hidden" name="ePNAccount" value="05971">
<input type="hidden" name="ReturnToURL"
value="http://www.secretweaponlures.com/newsite/form1.htm">
<input type="hidden" name="ReturnApprovedURL"
value="http://www.secretweaponlures.com/newsite/form1.htm">
<input type="hidden" name="ReturnDeclinedURL"
value="http://www.secretweaponlures.com/dreamweaver/oops.htm">
<input type="submit" name="Submit" value="Add To Cart">

Naming them both ItemDesc didn't work, and only included the first select,
not the second one.
Thank You very much for your help!
 
L

Leif K-Brooks

Charles said:
I need to take the values of two select boxes and have the results submitted
in a value named "ItemDesc".

Have your server-side script do that. You can't do it client-side.
 
M

Mark Parnell

I need to take the values of two select boxes and have the results submitted
in a value named "ItemDesc".

Get your form handler script to combine them.
 
K

kayodeok

Would you please give me an example? I'm very new at all of
this!

Thanks!

If I understand this correctly, it is a matter of joining the two
strings in your favorite server side language

(This is generic)

$ItemDesc = $ItemDesc1 . " " . $ItemDesc2

$ItemDescr1 is your first Combo Box
$ItemDescr2 is your second Combo Box

or am I missing something?
 
L

Leif K-Brooks

kayodeok said:
If I understand this correctly, it is a matter of joining the two
strings in your favorite server side language

(This is generic)

$ItemDesc = $ItemDesc1 . " " . $ItemDesc2

If you mean that your code snippet is generic to all server-side
languages, it isn't. It will work in PHP with register_globals on, and
Perl if you happen to have assigned $ItemDesc1 and $ItemDesc2, but
that's about it.

But I've probably misunderstood you, and you're saying that it's generic
to something else.
 
K

kayodeok

If you mean that your code snippet is generic to all server-side
languages, it isn't. It will work in PHP with register_globals
on, and Perl if you happen to have assigned $ItemDesc1 and
$ItemDesc2, but that's about it.

But I've probably misunderstood you, and you're saying that it's
generic to something else.

Actually, I was referring to the idea that he needs to join to
strings as generic.

And I did mention that $ItemDesc1 refers to the first combo box (I
know he named it as $ItemDesc but then he named both as $ItemDesc)

And I know that in PHP it should be

$ItemDesc = $_POST["ItemDesc1"] . " " . $_POST["ItemDesc2"]

I hope this clarifies my original post
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top