Click here to Skip to main content
15,889,874 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
JavaScript
<script>
    function myFunction() {
        document.getElementById("demo").innerHTML += "<select><option value='1'>option1</option><option value='1'>Option2</option><option value='1'>Option3</option><option value='1'>Option4</option><option value='1'>Option5</option></select>";

        var select = document.createElement("select");
 //replace this second dropdown with the coldfusion query in below place
        var option = document.createElement("option");
        option.value = "SubOption1";
        option.text = "SubOption";
        select.appendChild(option);
 
        document.getElementById("demob").appendChild(select);
 
        return false;
    }
</script>


The above javascript shows dropdown with 5 options, when any of that is selected, the second dropdown shows and list "SubOption1" as the second dropdown options.

My question or where i need further help is, i have a coldfusion query
<cfselect name="NameList" size="1" query="UserRole_q" value="EmpID" display="Name" selected="#temp#"		>
              <option value="-1"></option>
            </cfselect> 

which pulls all employee names from the database and list as options.

so, to end my question , i need help placing this coldfusion query to replace the second dropdown ("SubOption1") in the javascript above. thank you for your time
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900