Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

Using cfform in AJAX containers

From: ColdFusion 9: AJAX Controls and Techniques

Video: Using cfform in AJAX containers

One of the slickest pieces of ColdFusion's AJAX functionality is the handling of form submissions inside bound elements. In this video, I'm going to show you how ColdFusion handles submitting a form inside of a bound cfdiv. So let's start by opening up login.cfm. So this contains a simple login form. I have my username, and password and a Submit button. At the top, I'm just simply dumping the results of the FORM scope whenever the login.cfm form is submitted. So I'm going to use this form inside of a cfdiv to embed a login form inside of another page.

Using cfform in AJAX containers

One of the slickest pieces of ColdFusion's AJAX functionality is the handling of form submissions inside bound elements. In this video, I'm going to show you how ColdFusion handles submitting a form inside of a bound cfdiv. So let's start by opening up login.cfm. So this contains a simple login form. I have my username, and password and a Submit button. At the top, I'm just simply dumping the results of the FORM scope whenever the login.cfm form is submitted. So I'm going to use this form inside of a cfdiv to embed a login form inside of another page.

So let's create a new file for hosting our login form. So I'm going to call this ajaxformsubmit. On this page, the first thing I'm going to do is I'm just going to dump out the form scope. So when a form has been submitted on this page, I can see all of its values. So we'll say label=FORM scope in ajaxformsubmit.cfm. All right, then at the top, I'm going to do a cfdiv.

I'm going to bind it to our login form, login.cfm. So let's go and take a look at the form in our browser, and see what happens. So, open up ajaxformsubmit. Here is the FORM scope in ajaxformsubmit.cfm. I'm going to go ahead and fill out this file or form rather. My username and password. I'm going to click Login. Now, you'll notice that ajaxformsubmit is dumping out the form scope, but my login.cfm is not.

The reason this happens is because we're using standard form tags, regular old HTML form tags inside of login.cfm. So I'm going to change these to be cfform tags. So I'll go ahead and dave that file. We'll go back to the browser. I'm going to reload this page, and you'll notice that I get an error. It says "the imports for the CFFORM are missing." "Use CFAJAXIMPORT to import them on your main page." So what's going on here? Let me just get rid of all the errors. It's that on this page I do not actually have any cfform tags.

They're all inside of login.cfm. So in order to use any cfform functionality, I need to actually make sure that I tell this page that I'm going to be using a cfform. So any AJAX-y tags that I use inside login.cfm, I need to actually make sure I import their AJAX functionality into the parent page. So let's switch back to the browser and reload again. Now I don't get any errors. So we're going to hide that for now. So let's go ahead and submit our login form again. So I'll say danshort, my password, then click Login.

You'll notice that this did not change, but up here at the top I'm now getting FORM Values in login.cfm. I not only have my LOGINBUTTON and my USERNAME and PASSWORD, but I have all of the CF container-specific attributes as well. If I take a look at Firebug, let's go ahead and submit this form again. So we'll do danshort, my password, click Login. We can see that it's making a POST to login.cfm. It's pulling in this response, which has all of my form functionality on it, and then rendering it back into the page.

That's all it takes to have a form submit within its own little AJAX-y window with ColdFusion. You need to have a page with a cfform tag on it. The parent page must call that page in a cfdiv or other bound element like cflayout. I could have had this login form inside of the tab of a cflayout tag. You'll need to make sure that the parent page has access to all of the cfform scripts by using the CFAJAXIMPORT tag to pull in the all the necessary JavaScript functionality.

Show transcript

This video is part of

Image for ColdFusion 9: AJAX Controls and Techniques
ColdFusion 9: AJAX Controls and Techniques

35 video lessons · 3146 viewers

Daniel Short
Author

 
Expand all | Collapse all
  1. 2m 41s
    1. Introduction
      59s
    2. Setting up and using the exercise files
      1m 42s
  2. 33m 31s
    1. Using the cfdiv and cfpod tags
      7m 28s
    2. Using the cfwindow tag
      10m 57s
    3. Securing container contents
      3m 38s
    4. Manipulating container contents
      5m 13s
    5. Debugging AJAX behaviors
      6m 15s
  3. 22m 34s
    1. Building tabs
      9m 1s
    2. Building accordions
      5m 49s
    3. Building border layouts
      7m 44s
  4. 42m 13s
    1. Using rich prompts with cfmessagebox
      8m 47s
    2. Uploading files with cffileupload
      8m 52s
    3. Understanding advanced cffileupload
      7m 23s
    4. Building with quick and easy Auto-Suggest
      6m 11s
    5. Using the cfprogressbar tag
      11m 0s
  5. 25m 37s
    1. Binding data to form fields
      8m 54s
    2. Building dependent select menus
      5m 32s
    3. Using cfform in AJAX containers
      3m 52s
    4. Using the cfslider tag
      7m 19s
  6. 37m 31s
    1. Understanding grid basics
      7m 28s
    2. Sorting and grouping data in grids
      3m 34s
    3. Binding data to grids
      5m 35s
    4. Editing data in static grids
      9m 16s
    5. Editing data in bound grids
      11m 38s
  7. 17m 17s
    1. Building a basic tree
      5m 10s
    2. Using query-driven trees
      5m 9s
    3. Binding complex data to a tree
      6m 58s
  8. 16m 4s
    1. Creating a map with markers
      4m 54s
    2. Adding additional markers to a map
      1m 43s
    3. Using custom markers and map controls
      5m 22s
    4. Dynamically populating marker content
      4m 5s
  9. 15m 15s
    1. Accessing CFCs from JavaScript
      8m 56s
    2. Performing asynchronous processing
      4m 22s
    3. Using setForm to submit to a CFC
      1m 57s
  10. 17s
    1. Goodbye
      17s

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ .

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Join now Already a member? Log in

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed ColdFusion 9: AJAX Controls and Techniques.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member ?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferences from the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Learn more, save more. Upgrade today!

Get our Annual Premium Membership at our best savings yet.

Upgrade to our Annual Premium Membership today and get even more value from your lynda.com subscription:

“In a way, I feel like you are rooting for me. Like you are really invested in my experience, and want me to get as much out of these courses as possible this is the best place to start on your journey to learning new material.”— Nadine H.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.