Professional Web Applications Themes

ColdFusion and JavaScript??? - Macromedia ColdFusion

I have this javascript that works well... [url]http://www.hotarea.com/fast/display.exe?show+javascript&form_elements&formsDro pD[/url] own2D.html It's a combo box where the second dropdown is based on the first selected dropdown box. Again, no problems, all works well. Here's the javascript...... <script language="Javascript"> var arrayData = new Array(); arrayData[0] = 'SALES|[SAL] User 01|' arrayData[1] = 'SALES|[SAL] User 02|' arrayData[2] = 'SALES|[SAL] User 03|' arrayData[3] = 'MARKETING|[MAR] User 01|' arrayData[4] = 'MARKETING|[MAR] User 02|' arrayData[5] = 'MARKETING|[MAR] User 03|' arrayData[6] = 'TECHNOLOGY|[TEC] User 01|' arrayData[7] = 'TECHNOLOGY|[TEC] User 02|' arrayData[8] = 'TECHNOLOGY|[TEC] User 03|' function populateData( name ) { select = window.doent.form.SubCategory; string = ""; // 0 ...

  1. #1

    Default ColdFusion and JavaScript???

    I have this javascript that works well...

    [url]http://www.hotarea.com/fast/display.exe?show+javascript&form_elements&formsDro pD[/url]
    own2D.html

    It's a combo box where the second dropdown is based on the first selected
    dropdown box. Again, no problems, all works well. Here's the javascript......

    <script language="Javascript">
    var arrayData = new Array();
    arrayData[0] = 'SALES|[SAL] User 01|'
    arrayData[1] = 'SALES|[SAL] User 02|'
    arrayData[2] = 'SALES|[SAL] User 03|'
    arrayData[3] = 'MARKETING|[MAR] User 01|'
    arrayData[4] = 'MARKETING|[MAR] User 02|'
    arrayData[5] = 'MARKETING|[MAR] User 03|'
    arrayData[6] = 'TECHNOLOGY|[TEC] User 01|'
    arrayData[7] = 'TECHNOLOGY|[TEC] User 02|'
    arrayData[8] = 'TECHNOLOGY|[TEC] User 03|'

    function populateData( name ) {
    select = window.doent.form.SubCategory;
    string = "";
    // 0 - will display the new options only
    // 1 - will display the first existing option plus the new options
    count = 0;
    // Clear the old list (above element 0)
    select.options.length = count;
    // Place all matching categories into Options.
    for( i = 0; i < arrayData.length; i++ ) {
    string = arrayData.split( "|" );
    if( string[0] == name ) {
    select.options[count++] = new Option( string[1] );
    }
    }
    // Set which option from subcategory is to be selected
    // select.options.selectedIndex = 2;
    // Give subcategory focus and select it
    // select.focus();
    }
    </script>

    SO...........

    I was wanting to have my ColdFusion query results be in the array instead of
    hard coding the array. Is there any way to do this? I think I'm getting
    confused about the server-side vs the client-side.

    Thanks a lot

    skooter Guest

  2. #2

    Default Re: ColdFusion and JavaScript???

    <cfset ctr = 0>
    <cfoutput query="yourqueryname">
    arrayData[#ctr#] = "#yourqueryname.col1#|#yourqueryname.col2#|";
    <cfset ctr = ctr + 1>
    </cfoutput>
    gwgiswebmaster Guest

Similar Threads

  1. Javascript in a Coldfusion Flash for - HOW????
    By Joe Science in forum Coldfusion Flash Integration
    Replies: 0
    Last Post: July 24th, 10:44 PM
  2. Javascript and Coldfusion
    By rental08 in forum Coldfusion - Getting Started
    Replies: 1
    Last Post: August 17th, 05:54 PM
  3. javascript, coldfusion expression
    By AcidGuy in forum Coldfusion - Advanced Techniques
    Replies: 2
    Last Post: July 30th, 07:09 PM
  4. Help with Javascript/Coldfusion Scroller
    By turnerpro1 in forum Macromedia ColdFusion
    Replies: 4
    Last Post: April 14th, 02:33 PM
  5. Communication - Coldfusion and Javascript
    By jce1975 in forum Macromedia ColdFusion
    Replies: 6
    Last Post: March 3rd, 02:58 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139