Search This Blog

Monday 1 October 2012

Add Remove class name to parent node based on the selected country has states or not

Add class to parent node based on the selected country has states (dropdown) or not (textbox)

Open the file js\varien\form.js and navigate to _checkRegionRequired: function()

Add the following code to add new class name to the parent tag
        
                if (!currentElement.parentNode.hasClassName('hide-select-design')) {
                    currentElement.parentNode.addClassName('hide-select-design');
                }

Add the following code to remove new class name from the parent tag
                if (currentElement.parentNode.hasClassName('hide-select-design')) {
                    currentElement.parentNode.removeClassName('hide-select-design');
                }


No comments:

Post a Comment