| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Product Combo Box Issue | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
Product Combo Box Issue
it used to be in xcart 4 there was a Validation script (JavaScript) box, for which i input something like this:
if (document.getElementById('po573').selectedIndex== 0) {alert('Please select your color.'); return false;} if (document.getElementById('po574').selectedIndex== 0) {alert('Please select your size.'); return false;} so i would make the default combo box selection something like: Please Select... and if they didnt change the combo box it would throw the customer a message saying make a selection. how is this achieved in xcart5? Core version: 5.2.15
__________________
X-Cart version 4.4.4 PHP 5.2.17 MySQL server 5.1.56 |
|||||||
#2
|
|||||||||
|
|||||||||
Re: Product Combo Box Issue
XC5 should be using HTML5 out of the box and this is easily done with simple HTML5 rules. No js required.
Unfortunately I don't think XC5 is coded to take advantage of this so you will have to do this yourself via a custom module. Basically it comes down to adding new <option> tag as first one in the <select> and setting its properties as below Code:
Here is live example - https://www.cflsystems.com/site-structured-data-for-x-cart-5.html It is on XC4 but the idea is the same
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
|
#3
|
|||||||
|
|||||||
Re: Product Combo Box Issue
wouldnt that effect every combo box though?
some combo boxes start at a default that doesnt need to be changed, then wouldnt the default value not be selectable?
__________________
X-Cart version 4.4.4 PHP 5.2.17 MySQL server 5.1.56 |
|||||||
#4
|
|||||||||
|
|||||||||
Re: Product Combo Box Issue
It will affect all of them yes but you can limit which ones are affected with your custom module. In XC5 you can't just go an change some code - it has to be done with a module or you lose changes on next upgrade.
Also - this will not have any affect on which option is selected on page load if its value is passed. It will only be the first one to start with if no option is selected by default.
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
|
|||
X-Cart forums © 2001-2020
|