VirtueMart Forum

VirtueMart 2 + 3 + 4 => Product creation => Topic started by: techrahul87 on November 27, 2012, 10:22:46 AM

Title: Virtumart Custom fields with sub level
Post by: techrahul87 on November 27, 2012, 10:22:46 AM
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.  :)




Title: Re: Virtumart Custom fields with sub level
Post by: balai on November 27, 2012, 17:34:49 PM
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