close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

how to change from text input to select drop down

Thread began 5/18/2011 9:57 pm by James L | Last modified 4/24/2014 10:09 am by Jason Byrnes | 2449 views | 7 replies |

James L

how to change from text input to select drop down

I can't get this to work. I want to change the standard quantity text input box to a drop down menu to restrict the number of items the user can select, but when I change it the "add to cart button" does nothing... help!

original code:

<input type="hidden" name="proResCart_1_ID_Add" value="<?php echo $row_rsItems["ItemID"]; ?>" >
<input type="text" name="proResCart_1_Quantity_Add" value="1" size="4" >
<input type="image" src="WA_eCart/Images/Pacifica/Btn1_EN_addtocart.gif" border="0" class="eC_ImageButton" value="Add to Cart" name="proResCart_1_ATC">

my new but not working attempt:

<input type="hidden" name="proResCart_1_ID_Add" value="<?php echo $row_rsItems["ItemID"]; ?>" >
<select name="quantity">
<option name="ProResCart_1_Quantity_Add"value="1"selected="selected">1</option>
<option name="ProResCart_1_Quantity_Add"value="2">2</option>
<option name="ProResCart_1_Quantity_Add"value="3">3</option>
</select>
<input type="image" src="WA_eCart/Images/Pacifica/Btn1_EN_addtocart.gif" border="0" class="eC_ImageButton" value="Add to Cart" name="proResCart_1_ATC">

Sign in to reply to this post

Jason ByrnesWebAssist

your select list must be named the same as the original text box, the name for the text box was "proResCart_1_Quantity_Add":
<input type="text" name="proResCart_1_Quantity_Add" value="1" size="4" >

your select list must use the same name:
<select name="proResCart_1_Quantity_Add">

instead of:
<select name="quantity">


the options do not get a name attribute, only the select element. Options only get a value attribute.

change:
<option name="ProResCart_1_Quantity_Add"value="1"selected= "selected">1</option>

to:
<option value="1"selected= "selected">1</option>

Sign in to reply to this post

James L

Drop down choice not updating

Hi,
The drop down changes in your previous reply work great on my "choose product" page. Thank you. However, on the cart page I also want a drop down menu to change the quantity but limit their choices to 1, 2, or 3. The previous column displays the quantity previously selected (this works fine), but if they use the drop down menu to choose a different quantity and then press "update" the quantity doesn't change--the change doesn't appear in the quantity display column, and it doesn't change when they continue on to the confirm page.
(Sorry this is so lengthy...) Here's the code I'm using:

<td class="eC_FormItem">
<?php echo $proResCart->DisplayInfo("Quantity"); ?>
</td>

<td class="eC_FormItem"><input type="hidden" name="proResCart_1_ID_Add" value="<?php echo $row_rsItems["ItemID"]; ?>" >
<select name="proResCart_1_Quantity_Add">
<option value=""selected= "selected"></option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
<input type="hidden" name="proResCart_1_ID_Add" value="<?php echo $row_rsItems["ItemID"]; ?>" >
</td>

Sign in to reply to this post

Jason ByrnesWebAssist

in the cart display, place your cursor where the drop down should go, then go to Insert -> WebAssist -> eCart -> Updateable List. When prompted select the cart object and the quantity column.

after the list is added, select it in design view, then click the list values button in the properties panel to add the list options.

Sign in to reply to this post

James L

Works!

Thanks for the help, it now works just as I hoped it would.

Sign in to reply to this post

Jason ByrnesWebAssist

you're welcome.

Sign in to reply to this post

Maggie Simpson

Drop Down Quantity Menu

Hi Jason,
I'm attempting to adjust our "add to cart" object to use a drop down menu instead of a text input field for quantity (as James L is doing above). My difficulty is that the quantities available for the menu are variable (actually a calculation of what is available in inventory subtracting floor models, both fields from our database). So for one item it could be three available, for another it could be only one available. I want the quantities on the drop down menu to ascend 1, 2, 3...etc until the max quantity (from the calculation) is reached. Is this even a possibility? Thanks in advance for any help!

Sign in to reply to this post

Jason ByrnesWebAssist

its posible but would take hand coding.

you would need a recordset to return the maximum quantity field, then hand code a loop to go from 1 to the max.

for example:

$max=$row_recordsetName['MaxQTYColName'];
for($i=1;$i<$max;$i++){
echo("<option value=\"".$i."\">".$i."</option>");
}




if you need help setting this up, we can help through a premiere support appointment:
http://www.webassist.com/premier_request.php

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...