One thing I forgot to mention. If you use the below method, then you'd
reference the values on the ColdFusion page in the URL scope.

URL.key1
URL.key2
Etc.

If you need a POST then you'd just change the var references to the FORM
scope, and change $.get to $.post


andy

-----Original Message-----
From: Andy Matthews [mailto:[email protected]] 
Sent: Friday, January 22, 2010 9:15 AM
To: cf-talk
Subject: RE: AJAX Question


Bear in mind that you do not insert values into a database with AJAX. AJAX
is merely  way to pass said values to the processing page of your choice
without page refresh.

So assuming you know how to do a database insert with ColdFusion, you'd just
need to know how to pass the values from your client code to your ColdFusion
page.

jQuery makes this very simple:

$.get("http://www.yoursite.com/path/to/coldfusion/file.cfm";, {
        // here's the key value pairs you want to pass in your request
        key1: 'value one',
        key2: 'value two',
        key3: 'value three'
},function(data){
        // if your processing page will be passing data BACK to your client
page
        // then you'd do something with that data here.
}); 

-----Original Message-----
From: Matthew Allen [mailto:[email protected]]
Sent: Friday, January 22, 2010 8:48 AM
To: cf-talk
Subject: AJAX Question


Can anyone please give me pointers or real life example of how to insert
simple form field values into a database using AJAX.

Many thanks.

Matt 





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:330015
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to