• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 10. Adding JavaScript to Your Forms

Chapter 10. Adding JavaScript to Your Forms

In Chapter 5, “Interacting with Databases: Inserting, Updating, and Deleting,” you saw a way to use JavaScript to verify that a user wanted to proceed with the deletion of a database record. Certainly, including this kind of confirmation step is good interface design, but if you didn't know any JavaScript, you would most likely implement the confirmation by adding an additional ColdFusion script to your application. The script would ask the user whether he or she wanted to continue and would pass along the primary key of the record to be deleted if the user chose to proceed. Technically speaking, there's no harm in doing the confirmation this way, but you're asking your ColdFusion server to do some work that JavaScript could be doing instead. By having JavaScript handle the confirmation, you're actually helping your server to run more efficiently.

But what if you haven't had the chance to learn JavaScript? How can you take advantage of it in your ColdFusion applications if you haven't had the chance to study it? Allaire (now Macromedia) anticipated this dilemma prior to the release of ColdFusion 3.0. Its solution was to enable you to ask ColdFusion to incorporate JavaScript into your applications for you. That way, you could enjoy the benefits of JavaScript without having to write the JavaScript code yourself.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint