Good evening. I am new to the forum, so please bare with me if I talk 'stupid'.
I have a form that I want to have a set of fields populate with a color that corresponds to a color. For whatever reason, everything I have tried does not work.
Here is something that will work...but only for one entry.
var height = this.getField("Text2");
height.strokeColor = ["RGB",0.5,0.5,1]; //Change border to dark blue
height.fillColor = ["RGB",0,0,0.7]; //Change fill to light blue
height.textColor = ["RGB",0.5,0.5,0]; //Change text to light yellow
var heightEntered = this.getField("Text2");
var height = parseInt(heightEntered);
switch(height) {
case 5:
height.strokeColor = ["RGB",0.5,0.5,1]; //Change border to dark blue
height.fillColor = ["RGB",0,0,0.7]; //Change fill to light blue
height.textColor = ["RGB",0.5,0.5,0]; //Change text to light yellow
break;
case 10:
height.strokeColor = ["RGB",0.5,0.5,1]; //Change border to dark blue
height.fillColor = ["RGB",0,0,0.7]; //Change fill to light blue
height.textColor = ["RGB",0.5,0.5,0]; //Change text to light yellow
break;
default:
height.strokeColor = ["RGB",0.8,0.5,1]; //Change border to dark blue
height.fillColor = ["G", 1]; //Change fill to light blue
height.textColor = ["G", 0]; //Change text to light yellow
break;
}
I have tried so many variations, and I am fearful that maybe I am misunderstanding colors themselves.
I.E.- I want to do the color arrangements in CMYK.. The commented part to the right are the different case's that will exist...
aqua = ["CMYK", 76, 6, 37, 0]; //5,15,25,35,45,55
teal = ["CMYK", 72, 0, 60, 0]; //6,16,26,36,46,56
magenta = ["CMYK", 39, 100, 8, 1]; //7,17,27,37,47,57
lightblue = ["CMYK", 56, 14, 0, 0]; //8,18,28,38,48,58
green = ["CMYK", 82, 16, 100, 3]; //9,19,29,39,49,59
bronze = ["CMYK", 24, 58, 100, 9]; //0,10,20,30,40,50,60
vectorpurple = ["CMYK", 83, 100, 15, 10]; //11,21,31,41,51
gray = ["CMYK", 55, 54, 62, 30]; //12,22,32,42,52
darkblue = ["CMYK", 100, 80, 47, 51]; //13,23,33,43,53
gold = ["CMYK", 4, 5, 92, 0]; //14,24,34,44,54
Does anyone have any input they could give me, or any direction they can send me so I can find the answers to this...I am hoping to figure this out before this Friday night! 11/25/2011
Thanks in advance to all you JavaScript/Adobe geniuses.
J
// Get the value that the user entered and convert it to an integer
var heightEntered = parseInt(this.getField("Text2").value);
switch (heightEntered) {