Saving to a database with ColdFusion using jQuery

A commenter asked me how to extend a previous jQuery post to perform the database save via ColdFusion.  It is REALLY easy (and please keep in mind this is meant to be a SIMPLE example, not production code).  From the jQuery side my example only required the following code to ship the data off to ColdFusion:

function fSave(){
you=$("#you").val();
// Try to save
$.get("adduser.cfm?"+"you="+you , function(data){
// Result
alert(data);
window.location=location.href;
});
}

The adduser.cfm page then validates and inserts the data and returns a success or failure message.

See it hereGet it here.

2 thoughts on “Saving to a database with ColdFusion using jQuery”

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.