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

Calling a method from a form

From: ColdFusion Power Workshop

Video: Calling a method from a form

I want to show you an example of calling a method of a component from within the action attribute of a form. And I have two pages set up here, booking form instance and booking properties. I'm going to take this form, and call a method from within the booking properties component within the action page to display the results of the form. So I'll put it in the browser first.

Calling a method from a form

I want to show you an example of calling a method of a component from within the action attribute of a form. And I have two pages set up here, booking form instance and booking properties. I'm going to take this form, and call a method from within the booking properties component within the action page to display the results of the form. So I'll put it in the browser first.

And I'll scroll down here, and fill this out. Once I fill it out, I'll click Book A Tour, and yes, number of people is not perfect. But that's not going to affect what we're doing. And you can see, (LAUGH) that's why number of people doesn't look quite perfect. But what I did was called a method of the booking properties. The method was, display tour details. What I did was placed that information, that URL, right here within the action attribute of the form.

Now, in this example, you can see, its going to our local host. But what you would do is put the domain name in this action area. And if you had any arguments for that particular method, what we could do is put an ampersand. And this would be argument one, as an example, equals. And whatever argument one would be, I'll just say the number one ampersand. So you would just keep adding those if you needed to when you called the method. I don't need any of that for this particular example. It's just calling the method of display tour details. Now, somewhat needless to say, this is not the most secure way to work with a component.

It also assumes that this is not an instantiated component, so this is simply a static method call from a component. But it is possible to do, I wanted to make you aware that that's possible within the display tour details method. I do have a couple of pieces in here, you can see, access equals remote. And my return type on this particular example is set to a string, because it's going to return all of this information. But this access equals remote attribute of our display tour details method is necessary in order to be able to access it through that particular method, by calling it with the action attribute of a form.

Now, it is possible to have different access types for methods. As you can see, there are three different access types within this component. So, if you make a method access equals remote, you are not limited in that you have to make every method within the component that same access level. Your components can store different methods with different access levels, depending upon your needs. But that is how you can use a method call for a component, from the action attribute of a form.

Show transcript

This video is part of

Image for ColdFusion Power Workshop
ColdFusion Power Workshop

39 video lessons · 928 viewers

Candyce Mairs
Author

 
Expand all | Collapse all
  1. 1m 35s
    1. Welcome
      1m 35s
  2. 41m 29s
    1. ColdFusion installation
      9m 2s
    2. Installing ColdFusion Builder
      5m 41s
    3. Setting up the course files
      2m 0s
    4. ColdFusion Builder project setup
      7m 25s
    5. ColdFusion 10 Administrator enhancements
      6m 50s
    6. Setting up the database
      2m 30s
    7. Creating an Apache Derby data source
      4m 25s
    8. Customizing the ColdFusion Builder interface
      3m 36s
  3. 49m 50s
    1. What is the application framework?
      3m 20s
    2. CFC placement
      6m 47s
    3. Planning event code
      6m 28s
    4. Initializing application-level variables
      10m 14s
    5. Application methods
      6m 51s
    6. Triggering application methods
      8m 14s
    7. Request methods
      7m 56s
  4. 39m 45s
    1. Levels of error handling
      3m 50s
    2. Adding a site-wide error handler
      8m 22s
    3. Creating error templates
      8m 40s
    4. Using the error templates
      8m 31s
    5. Adding the onError method
      8m 15s
    6. Additional tips on error handling
      2m 7s
  5. 36m 6s
    1. What is a CFC?
      4m 50s
    2. Creating a static CFC
      8m 11s
    3. Calling a static CFC
      6m 47s
    4. Creating an instance-based CFC
      7m 16s
    5. Invoking an instance-based CFC
      9m 2s
  6. 28m 3s
    1. Reviewing the booking form
      7m 42s
    2. Working with the booking area component
      8m 33s
    3. Submitting the booking form
      7m 20s
    4. Controlling client-side form validation
      4m 28s
  7. 24m 10s
    1. Displaying the booking details
      8m 49s
    2. Inserting the booking form data
      7m 21s
    3. Creating an email confirmation
      8m 0s
  8. 29m 17s
    1. Using the cfproperty tag
      6m 20s
    2. Coding an instance-based component
      7m 23s
    3. Running the instance-based component
      7m 28s
    4. Calling a method from a URL
      4m 33s
    5. Calling a method from a form
      3m 33s

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 Power Workshop.

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.

Are you sure you want to delete this note?

No

Your file was successfully uploaded.

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.