[thelist] [CFand JavaScript]: Two Select boxes dynamically generated

Susan Wallace susanhw at webcastle.com
Tue Nov 5 09:14:01 CST 2002


Greetings!

I am working to modify a script where JavaScript is used to create a SELECT
item in a form which when an item is chosen, a second select item is
populated with choices specific to the chosen item.

I am attempting to make this piece dynamically populate based on a CFOUTPUT
with a group attribute:

ProcessSteps = new Array(
//<CFOUTPUT Query="GetProcessSteps" Group="PSID">
new Array(
//<CFOUTPUT>
new Array("#JSStringFormat(PSDesc)#", #PSID#),
//</CFOUTPUT>
new Array("", 0)
),//</CFOUTPUT>
);

The problem that I have is line 8 above:
),//</CFOUTPUT>

If this is the last item in the Group output, the trailing comma does not
need to be there.

I had the same problem within the inner-output and was attempting to
resolve that issue by outputting a blank item ("", 0) but I am just
guessing that it will function properly, I am not yet able to get past the
final comma to verify.

To simplify, this is what I need to output so that the JavaScript function
can use it:

new Array(
new Array("Communicate these objectives to employees, students and
parents", 2),
new Array("Each student will have an individual education plan reviewed and
updated at least annually", 3),
new Array("Provide all students with a solid foundation in reading,
mathematics, and writing.", 4)
),


Is there a better way to do this that I'm missing?
How can I determine the count of a grouped output?

TIA for any suggestions!

Susan Wallace





More information about the thelist mailing list