News:

Looking for documentation? Take a look on our wiki

Main Menu

Virtumart Custom fields with sub level

Started by techrahul87, November 27, 2012, 10:22:46 AM

Previous topic - Next topic

techrahul87

Hi,

I am using virtuemart 2.0.14 and I am stuck with a problem.
I have a custom field "COLOR".

Now the problem is when we select  any color say red from drop down color, there will be another dropdown say "SUB COLOR" which will have sub color codes for red.
if user select blue then it will have sub color codes for blue and so on.

Can we achieve this functionality by using virtuemart custom fields or I have to code it.  :)





balai

I think that you can create a javascript object with all the color names and the color codes. e.g. myColors={red:'#ff0000', black:#000000, etc};
Then assign a function on the change of the drop down that fills an input text with a color code using the myColors object.

You can do that either by hacking an existing custom field or creating a new one