> Hope this one is easy... how can I get the selected value from a form's
> select box and then pass that value as a variable in a href? Can it be done
> with an onClick event?
>
> <a onclick="*some js here*;"
> href="/account/index.cfm?mode=wishlist&productid=*js value here*">Add to
> Wishlist</a><br />

The solutions that Charlie and Duane provided are perfectly good, but
it's worth pointing out that URLs have a search attribute, which you
can set directly:

<a href="/account/index.cfm?mode=wishlist&productid="
onclick="this.search+=document.forms[0].mySelect.options[document.forms[0].mySelect.selectedIndex].value">Add
to Wishlist</a>

The advantage of this approach, if you even want to call it that, is
that you can modify rather than overwrite the URL assigned to the href
attribute of the link.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more information!

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326374
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to