troubleshooting Question

coldfusion ajax and jquery handling coldfusion query results

Avatar of CurtinProp
CurtinProp asked on
JavaScriptColdFusion LanguageAJAX
7 Comments2 Solutions719 ViewsLast Modified:
Hi all,

I want to work up a simple example which will do the following:

- Post form data using an ajax post to a CFC
- CFC takes the data and runs a query
- CFC returns results which are displayed on the original page.

so simple form elements would look like:

<form id="testform" name="testform" method="post" action="test.cfm" />

<select name="varlist" id="varlist">
<option id="1" value="1">1</option>
<option id="2" value="2">2</option>
<option id="3" value="3">3</option>
</select>

</form>

Then onchange I would want to fire off the ajax call to a coldfusion page with the query:

$("#varlist").change(function () {
var selectval = $('#varlist').val();


[i NEED HEP WITH THE FOLLOWING]
		
[ FIRE OFF THE AJAX CALL WITH THE VALUE TO THE COLDFUSION PAGE ]

[  RECEIVE THE RESULT FORM THE COLDFUSION PAGE ]

});


The query could be something simple like:

<cfquery name="testquery" datasource="TDS">

select * from table where some_id = ' [ #VARIABLE SENT VIA AJAX# ] '

</cfquery>


So I just need a bit of guidance in regards to the three steps, there doesnt seem to be a real stripped down beginner's example online.


cheers
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 2 Answers and 7 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros