I'm trying to populate a JS two dimensional array using CF..
this is that I have so far
var taskArray = new Array(<cfoutput>#alltasks.recordcount#</cfoutput>,3);
<cfoutput query="alltasks">
taskArray["#alltasks.task#",#alltasks.c_taskid#,#alltasks.c_activityid#];
</cfoutput>

I look at the source and it seems to be doing what I want..

var taskArray = new Array(10,3);
taskArray["Analysis",3,2];
taskArray["CBT",10,4];
taskArray["Classroom Training",9,4];
taskArray["Conference Call",11,4];
taskArray["Design",4,2];
taskArray["Development",5,2];
taskArray["Evaluation",7,2];
taskArray["Follow-Up",8,2];
taskArray["Implementation",6,2];
taskArray["SomeNewTask",21,2];

I have a select box that returns 2 or 4
I need this to populate a select box with the Array's 1 element as the
Option, and the 2nd as the value only if the 2 matches the third or if
4 does..
IE
the user selects the option that returns 2
the select box should populate with
Analysis,3
Design,4
Development,5
Evaluation,7
Follow-Up,8
Implementation,6
SomeNewTask,21

or 4
CBT,10
Classroom Training,9
Conference Call,11

I can hard code it but I cant do it dynamically..
//document.forms['laforma'].c_taskid.options[1] = new Option('Analysis', '3');
//document.forms['laforma'].c_taskid.options[2] = new Option('Design', '4');
//document.forms['laforma'].c_taskid.options[3] = new
Option('Development', '5');
//document.forms['laforma'].c_taskid.options[4] = new
Option('Implementation', '6');
//document.forms['laforma'].c_taskid.options[5] = new
Option('Evaluation', '7');
//document.forms['laforma'].c_taskid.options[6] = new Option('Follow-Up', '8');

can you guys assist me with populating the select box with that generated array?

Thanks!
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to