Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

make users choose

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 01-27-2010, 12:04 PM
 
delboy2028 delboy2028 is offline
 

Advanced Member
  
Join Date: Jan 2009
Location: UK
Posts: 97
 

Default make users choose

I have many products on my site with people to choose colours but people don't pic the colours and just have the selected one. how can i make users to have to chose a colour before adding to cart.

thanks
__________________
Version 5.3.1
Reply With Quote
  #2  
Old 01-27-2010, 04:06 PM
  gb2world's Avatar 
gb2world gb2world is offline
 

X-Wizard
  
Join Date: May 2006
Location: Austin, TX
Posts: 1,970
 

Default Re: make users choose

try this
__________________
X-CART (4.1.9,12/4.2.2-3/4.3.1-2/4.4.1-5)-Gold
(CDSEO, Altered-Cart On Sale, BCSE Preorder Backorder, QuickOrder, X-Payments, BCSE DPM Module)
Reply With Quote
  #3  
Old 01-28-2010, 06:50 AM
 
delboy2028 delboy2028 is offline
 

Advanced Member
  
Join Date: Jan 2009
Location: UK
Posts: 97
 

Default Re: make users choose

thanks but code not for 4.2
__________________
Version 5.3.1
Reply With Quote
  #4  
Old 01-28-2010, 09:22 AM
  ARW VISIONS's Avatar 
ARW VISIONS ARW VISIONS is offline
 

X-Man
  
Join Date: Jan 2007
Location: Pensacola, FL
Posts: 2,536
 

Default Re: make users choose

you will need to use JavaScript validation for this.
__________________
xcart 5.1.2
Reply With Quote
  #5  
Old 01-28-2010, 09:26 AM
 
delboy2028 delboy2028 is offline
 

Advanced Member
  
Join Date: Jan 2009
Location: UK
Posts: 97
 

Default Re: make users choose

to be fair am not good with JavaScript so would not know were to begin
__________________
Version 5.3.1
Reply With Quote
  #6  
Old 01-28-2010, 09:36 AM
  ARW VISIONS's Avatar 
ARW VISIONS ARW VISIONS is offline
 

X-Man
  
Join Date: Jan 2007
Location: Pensacola, FL
Posts: 2,536
 

Default Re: make users choose

this should still work. javascript is version independent.

You will just need to replace po3 with appropriate ID.

Note that the first selection in your dropdown should not be an actual option, but a generic place holder such as select or please choose.

if (document.getElementById('po3').selectedIndex == 0)
{ alert('Please select a size for your item.'); return false;
}
else return true;
__________________
xcart 5.1.2
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 07:30 AM.

   

 
X-Cart forums © 2001-2020