{"id":239,"date":"2010-05-01T10:43:54","date_gmt":"2010-05-01T15:43:54","guid":{"rendered":"http:\/\/www.cfchimp.com\/wordpress\/?p=239"},"modified":"2024-12-05T19:48:41","modified_gmt":"2024-12-06T00:48:41","slug":"saving-to-a-database-with-coldfusion-using-jquery","status":"publish","type":"post","link":"https:\/\/csimmons.dev\/blog\/2010\/05\/saving-to-a-database-with-coldfusion-using-jquery\/","title":{"rendered":"Saving to a database with ColdFusion using jQuery"},"content":{"rendered":"<div>\n<p>A commenter asked me how to extend <a href=\"https:\/\/csimmons.dev\/blog\/2010\/04\/use-jquery-to-enable-submit-button-and-set-form-action\/\">a previous jQuery post<\/a> to perform the database save via ColdFusion. \u00a0It is REALLY easy (and please keep in mind this is meant to be a SIMPLE example, not production code). \u00a0From the jQuery side my example only required the following code to ship the data off to ColdFusion:<br \/>\n<code><br \/>\nfunction fSave(){<br \/>\n\tyou=$(\"#you\").val();<br \/>\n\t\/\/ Try to save<br \/>\n\t$.get(\"adduser.cfm?\"+\"you=\"+you , function(data){<br \/>\n\t\t\/\/ Result<br \/>\n\t\talert(data);<br \/>\n\t\twindow.location=location.href;<br \/>\n\t});<br \/>\n}<br \/>\n<\/code><br \/>\nThe adduser.cfm page then validates and inserts the data and returns a success or failure message.<\/p>\n<p><a href=\"http:\/\/www.cfchimp.com\/chimp\/jquery-enabled-form-2.cfm\" target=\"_blank\">See it here<\/a> |\u00a0<a href=\"https:\/\/csimmons.dev\/blog\/wp-content\/uploads\/2010\/05\/jq-save-with-cf.zip\">Get it here<\/a>.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>A commenter asked me how to extend a previous jQuery post to perform the database save via ColdFusion. \u00a0It is REALLY easy (and please keep in mind this is meant to be a SIMPLE example, not production code). \u00a0From the jQuery side my example only required the following code to ship the data off to &#8230; <a title=\"Saving to a database with ColdFusion using jQuery\" class=\"read-more\" href=\"https:\/\/csimmons.dev\/blog\/2010\/05\/saving-to-a-database-with-coldfusion-using-jquery\/\" aria-label=\"Read more about Saving to a database with ColdFusion using jQuery\">Read more<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"_cloudinary_featured_overwrite":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[68],"tags":[48,26,28,16],"class_list":["post-239","post","type-post","status-publish","format-standard","hentry","category-developer","tag-coldfusion","tag-javascript","tag-jquery","tag-sql"],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pbVg43-3R","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/posts\/239","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/comments?post=239"}],"version-history":[{"count":0,"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/posts\/239\/revisions"}],"wp:attachment":[{"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/media?parent=239"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/categories?post=239"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/tags?post=239"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}