Accessing country dropdown value in cart via JavaScript

General ShopSite user discussion

Accessing country dropdown value in cart via JavaScript

Postby beley » Mon May 02, 2011 1:28 pm

I want to display a message to people ordering from Canada right when they use the shipping calculator. I tried to do this using Jquery but something is wrong with the ShopSite generated form -- I think it doesn't like that it simply says "selected" and not "selected='selected'". It also doesn't have an ID which would be nice.

I've tried looking for a javascript variable (ss_country) to find out what the country is when the shopping cart page reloads after calculating shipping, but it seems the ship to country is only available on the thank you page? ???

Any help would be greatly appreciated...
Brandon Eley
Certified ShopSite Designer
beley
 
Posts: 111
Joined: Sun Aug 06, 2006 10:05 am
Location: LaGrange, GA

Re: Accessing country dropdown value in cart via JavaScript

Postby loren_d_c » Mon May 02, 2011 1:55 pm

I don't know about jquery, but here is an example of straight JavaScript that may do what you are looking for:

http://support.lexiconn.com/news/viewtopic.php?t=289

-Loren
loren_d_c
 
Posts: 2572
Joined: Fri Aug 04, 2006 12:02 pm
Location: Anywhere

Re: Accessing country dropdown value in cart via JavaScript

Postby beley » Mon May 02, 2011 6:34 pm

That worked great, thanks Loren!
Brandon Eley
Certified ShopSite Designer
beley
 
Posts: 111
Joined: Sun Aug 06, 2006 10:05 am
Location: LaGrange, GA


Return to User Forum

Who is online

Users browsing this forum: No registered users and 118 guests

cron