View Full Version : Combining values of multiple drop down options
I am designing the front end of a shopping cart using Dreamweaver. For every product I have listed, there are two options (color and packaging.) I would like to have the combined values incorporated into a url that would direct them to my pre-existing shopping cart engine. I am probably lacking a great deal of learning on this subject, so in lieu of an answer, perhaps someone could point me to some tutorials as a last resort.
Added difficulty: Can I also have those two values "fill in" a price from my database?
page in question: http://www.shrink-it.com/pl2.html
Thank you in advance.
bump
Can anyone point me in the right direction? I can't seem to find any assistance on the subject. Perhaps I'm not using the right terms when searching?
rangana
05-08-2008, 08:35 PM
I'll base an example from your code:
<select name="select2" id="select2">
<option value="black">Black</option>
<option value="red">Red</option>
<option value="green">Green</option>
<option value="blue">Blue</option>
<option value="yellow">Yellow</option>
<option value="white">White</option>
</select>
<select name="select17" id="select17">
<option value="Master Reel">Bulk</option>
<option value="Reel">100 / Ft</option>
<option value="4 Foot Stick">4Ft</option>
<option value="1 foot piece">1 Foot</option>
</select>
<input type="button" value="submit" id="mysubmit">
<script type="text/javascript">
window.onload=function()
{
var color=document.getElementById('select2');
var length=document.getElementById('select17');
var trigger=document.getElementById('mysubmit');
var baselink='http://www.shrink-it.com/';
trigger.onclick=function()
{
if((color.value=='black')&&(length.value='Master Reel'))
location.href=baselink+'black.htm';
if((color.value=='red')&&(length.value='Reeel'))
location.href=baselink+'red.htm';
}
}
</script>
Aside from the script, i just added an id from the combo box :agree:
See if it helps :)
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.