I was trying to take the selected value from the select tag and pass it to cold fusion tags in jquery as follows.
select tag code:
<select id="selectco">
<cfoutput query="colist">
<option value="#cid#">#coname#</option>
</cfoutput>
</select>
jQuery code:
$(document).ready(function()
{
$("#selectco").change(function()
{
var e=document.getElementById("selectco");
var opt=e.options[e.selectedIndex].value;
$("#selectst").html("<cfquery name='stlist' datasource='tasks'>
select * from state where cid='"+opt+"'
</cfquery><select id='selectct'><cfoutput query='stlist'><option>#stname#</option></cfoutput>");
});
});
I was able to take the value to opt variable.But am unable to pass the value to the cfquery tag. Please help me.