View Full Version : Load SQL query results into a JavaScript array

09-19-2005, 05:50 PM
I am trying to figure out Javascript code needed to build a table array, populate the array with results of a SQL query at page load, and will support a function which dynamically populates a text-area with data from the array based on a user's choice of a related option/select list.

Particulars related to this effort:
option/select list named: "Subject"
textarea named: "Message"

SQL table to JavaScript Array:
RecID / Location / MsgTrigger / Subject / MsgInternal / MsgExternal

User action: Selects a subject text string, eg:Appointment Scheduled, from a drop-down select named "Subject".

Dynamic Action: MsgInternal (related to the "Subject") text needs to load into the textfield="Message", e.g.Appointment for <insert name> has been scheduled on <insert date/time> from the values found in the JavaScript array.

The above activity is performed within a Cold Fusion Page, running on IE 5.0+


09-19-2005, 10:44 PM
Any reason you have to do it that way?

I have dynamic cfm pages similar to this, but instead of storing the values in an array, it uses an AJAX-like setup. User chooses an option and the choice affects another form element. Much easier to write than trying to get everything in an array and such. Works fine in IE5.

Since they are password protected, I can't link them, but I could post code if you're interested, once I get home.