ColdFusion and JavaScript???

Ask a Question related to Macromedia ColdFusion, Design and Development.

  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.document.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. Similar Questions and Discussions

    1. using javascript variable in coldfusion
      Hi, how can i use a javascript varaible in coldfsuon tags?i dont want to passthose variables via hyperlink cause i need tovalues in current page. ...
    2. Javascript in a Coldfusion Flash for - HOW????
      Trying to figure this out. Any Ideas or examples. thanks
    3. Javascript and Coldfusion
      Can you have CF tags within javascript tags? thanks, Mike
    4. javascript, coldfusion expression
      hi guys! is there a way to embed a expression using javascript and coldfusion values? this variable is getting nut... <a...
    5. Help with Javascript/Coldfusion Scroller
      Im working on a news ticker or scroller for a hockey website that displays the scores from last nights games. I already have it basically working...
  3. #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

Posting Permissions

  • You may not post new threads
  • You may 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